UnityRenderStreaming icon indicating copy to clipboard operation
UnityRenderStreaming copied to clipboard

[BUG]: Input multitap is not working through remote input

Open codec-abc opened this issue 2 years ago • 3 comments

Package version

3.1.0-exp.7

Environment

* OS:Windows 
* Unity version: 2022.4.3f1
* Graphics API: Not relevant
* Browser: Chrome 115.0.5790.170 (Build officiel) (64 bits) (cohort: Stable)

Steps To Reproduce

  1. Create a blank Unity project
  2. Add the com.unity.renderstreaming package in the latest version and fix all issues detected by the wizard window.
  3. Import the com.unity.renderstreaming package sample in the project.
  4. Modify the existing CameraControl input map by adding an action that listen on Mouse left with a multi tap interaction: image
  5. Add the following line in the Start method of BroadcastSample.cs : map["DoubleClick"].AddListener((a) => Debug.LogError($"[Input Receiver] double click {Time.realtimeSinceStartup} {a.phase} {a.ReadValue<float>()}")); image
  6. Download the server app through the wizard, launch it, launch the Broadcast scene
  7. Open Chrome on the appropriate page (receiver/index.html) and double click in the canvas element.
  8. Look at the logs in Unity.

Current Behavior

The double click action is starting but canceled right away as we can see in the log.

Expected Behavior

The double click action should be triggered when a double click is done.

Anything else?

On the same scene I have a PlayerInput using the same action map and a similar script to print logs. This way the events are handled directly in Unity without the UnityRenderStreaming and WebRTC part. In that case the logs show that the double click is correctly detected when I perform it.

codec-abc avatar Aug 09 '23 12:08 codec-abc

@codec-abc You need to use InputReceiver component instead of PlayerInput to process remote input. Can you try that? image

karasusan avatar Aug 23 '23 04:08 karasusan

@karasusan Sorry if I was unclear. I did not have a InputReceiver and PlayerInput to process input at the same time. When testing the WebRTC package I had only a InputReceiver. I just used a PlayerInput once to tested directly in the editor to make sure the action map was properly configured (and it was).

With the InputReceiver single clicks were detected but it was behaving weirdly for the double click (which had the MultiTap modifier). On the first click the double click was starting but it was canceled right away. And the delay between the start and cancel events was almost 0 and was very inferior to the Max tap spacing value.

Yet, If it helps you I can try uploading the project here.

codec-abc avatar Aug 23 '23 07:08 codec-abc

@codec-abc Thanks for clarifying. It sounds like bugs in Render Streaming.

memo: URS-630

karasusan avatar Aug 29 '23 03:08 karasusan