I started integrating the WebRTC package including new input system last months on a PC at the the customer site. Now I wanted to continue via remote desktop and ran into problems with mouse UI input when working remote. The problem occurs in Unity editor and when using the Windows build. If I copy the same exe on my local PC, it works as expected. Mouse shows up in Input Debug view and events are fired. Even more confusing: Remote Input (similar to RemoteInput.cs from UnityRenderStreaming) works fine. Are there any known issues? I am using the stable branches of InputSystem, WebRTC and some code from UnityRenderStreaming on Unity 2019.1.12. Player settings / Active Input Handling is configured to use both but this does not affect the outcome. If I switching back to legacy input by using StandAloneInputModule the app works again without problems, but this won't work for web streaming. BTW: The UnityRenderSteaming sample project (modified) shows the same effects.
Have this problem in editor too when trying my games over remote desktop it does not respond to input on anything using the new input system
I found out that some parts of the input like for example click and mouse button down are detected and processed, but the mouse position is always (0; 0). If a button stays at tthe bottom left corner, it receives the click event. Even more strange: I saw that the mouse position is set correctly when I scroll using the mouse wheel. Then the mouse position stays on this position until the scroll wheel is active again at another position. Combining both scrolling and moving seems to work as well. In my tests I connected a Mac to a Windows 10 host with MS Remote Desktop and Jump Desktop. Another test from Windows 10 to Windows 10 showed the same behaviour. Thus the RDP client is not to blame.
I have this problem too! I can't use 2019.3f builds in remote desktop In editor works fine for me, but anything built doesnt response to mouse. Keyboard works fine
Setup Autohotkey Here's the script, you press F8 and it clicks like the hardware mouse. I can finally "use" my UI.... Code (JavaScript): F8:: While GetKeyState("F8", "P"){ Click Sleep 50 ; milliseconds } return
Mouse problems on Windows with RDP connections is a known issue. My guess is it's coming from the fact we switched entirely to RawInput for mouse input. The old input system has mixed mouse event handling where part of mouse input is picked up from WM_ messages and part of it is picked up through RawInput. At least that's my explanation so far but we haven't yet dug deeper into it. It's on the list but may or may not happen for 1.0.
Thanks for your reply. I currently have implemented a somewaht hacky workaround by using both input systems in parallel. While any streaming client is active I switch to the new input system and have event listener polling for a predefined hotkey of the local Keyboard to switch back to legacy input system. Anyway it would be cool if this were fixed one day.
We have a (native-side) fix in the landing pattern. It's making its way through the pipes and is expected to hit 2019.3 and 2020.1. Turns out the problem actually was that we only responded to relative mouse input from RawInput whereas with RDP connections, you get absolute mouse input. Easy fix.
Is this fixed in 2019.3? I had a problem with mouse (virtual/absolute input) when I use remote desktop (Mac, remote desktop client: AnyDesk, NoMachine) access in 2018.1, 2019.1 and I just downloaded 2019.3 and I face the same problem. My problem is that when I try to move the objects in Scene View or Inspector by dragging the mouse (in Editor), nothing happens. Neither I can rotate/pan the scene view camera because mouse input is not recognised. Mouse click is fine, it is just the delta of mouse input that are not recognised... (known issue for several years without solution)
Unfortunately,I face the same problem both in 2019.3.6f1 and 2019.3.5f1... it's installed on Mac Mojave 10.14.6 and I am connecting it via NoMachine. I don't think it's the problem of remote client (same problem with AnyDesk)
Is there any way of rotating the scene view camera with keyboards or script (that doesn't require Mouse delta)? Panning can be done with arrow key, but I can't find a way to orbit the scene view..
I dont think the fix will work for you here. It was a fix for Windows only. Could you file a bug report so we can investigate this please?
I can confirm I am facing the same issues: mouse not responding inside the scene view, in Unity 2019.3.7f1 installation on OSX Catalina, over a TeamViewer connection from a Windows machine Is there an issue set up so I can upvote?
Having an issue that seems related, but unfortunately is being difficult to reproduce. After upgrading, I'm noticing that when using Parsec or Steam Remote Play Together, the mouse does not behave correctly. I'll have to take a video next time, but it sort of looks like the mouse position is being reported incorrectly. We did not have this issue until we updated our project from 2019.1.2f1 to 2019.3.6f1, and the InputSystem from preview-3 to preview-6. Did that fix ever make it through @Rene-Damm? Just wondering if there's anything we can do, since my team is using Remote Play Together/Parsec to test during Covid stuff. I'll post an update when it happens again.
Connecting with RDP from Windows 10 (where I build the game) to an AWS NVIDIA Gaming PC g4 instance running Windows Server 2019 where I have to run the game, still no mouse rotation, Unity 2019.3.8f1, standard Windows RDP client.
What do you mean by mouse rotation? We detect the mouse cursor when in RDP. Are you referring to the mouse wheel? Please file a bug report so we can investigate.
Oh, I apologize, I did not say exactly what am I doing, but it's simple: I am unable to rotate the camera with the FreeCamera.cs script on it. The FreeCamera script comes from the "Core RP Library" package, and I'm using the latest version of it (version 7.3.1). Probably I could implement a workaround with custom input, like people are suggesting here, but the default script provided by Unity for rotating the camera does not work. But since the issue is said to be already fixed, I am not sure how this can be happening? I can file a bug report a bit later, if needed.
Note that the FreeCamera script in the Core RP package still uses the old input system. Does it work when you switch "Active Input Handling" in the player preferences to "Both"?
Yes, it does work OK locally, both inside the editor and the build. However, when I am launching the build on the remote machine, right mouse click rotation is unavailable. The script comes from Unity with the Core RP Library package, it's not mine. Just tried that, but no, it does not change anything. It was set for "Input Manager (Old)", and I've set it to "Both", created a new build and tested it. The result is the same: right mouse-click rotation does not work. Note: I am able to get it to work partially by adding additional mouse-tracking code to FreeCamera.cs that is provided by Serjiok in https://forum.unity.com/threads/right-click-mouse-not-work-on-a-remote-desktop.417324/ but the movement is a bit sluggish and each time I right-click and rotate, the camera angle resets to the original one and I the rotation starts from it's original orientation. Probably it can be fixed in the code, I did not yet modify what Serjiok provided, but if tracking the mouse is actually possible, and was working even with the "Input Manager (Old)" setting, then why FreeCamera.cs from Core RP Library is not using a working solution? The full code of my changed FreeCamera, with the code additions from Serjiok, the only new code is the `PostUpdate()` method: Code (CSharp): using System.Collections.Generic; namespace UnityEngine.Rendering { public class FreeCameraRDP : MonoBehaviour { [SerializeField] bool isRdpFixEnabled = false; /// <summary> /// Rotation speed when using a controller. /// </summary> public float m_LookSpeedController = 120f; /// <summary> /// Rotation speed when using the mouse. /// </summary> public float m_LookSpeedMouse = 10.0f; /// <summary> /// Movement speed. /// </summary> public float m_MoveSpeed = 10.0f; /// <summary> /// Value added to the speed when incrementing. /// </summary> public float m_MoveSpeedIncrement = 2.5f; /// <summary> /// Scale factor of the turbo mode. /// </summary> public float m_Turbo = 10.0f; private static string kMouseX = "Mouse X"; private static string kMouseY = "Mouse Y"; private static string kRightStickX = "Controller Right Stick X"; private static string kRightStickY = "Controller Right Stick Y"; private static string kVertical = "Vertical"; private static string kHorizontal = "Horizontal"; private static string kYAxis = "YAxis"; private static string kSpeedAxis = "Speed Axis"; Vector2 lastAxis; float x = 0; float y = 0; float xSpeed = 0; float ySpeed = 0; void OnEnable() { xSpeed = ySpeed = m_LookSpeedMouse; RegisterInputs(); lastAxis = new Vector2(Input.mousePosition.x, Input.mousePosition.y); } void RegisterInputs() { #if UNITY_EDITOR List<InputManagerEntry> inputEntries = new List<InputManagerEntry>(); // Add new bindings inputEntries.Add(new InputManagerEntry { name = kRightStickX, kind = InputManagerEntry.Kind.Axis, axis = InputManagerEntry.Axis.Fourth, sensitivity = 1.0f, gravity = 1.0f, deadZone = 0.2f }); inputEntries.Add(new InputManagerEntry { name = kRightStickY, kind = InputManagerEntry.Kind.Axis, axis = InputManagerEntry.Axis.Fifth, sensitivity = 1.0f, gravity = 1.0f, deadZone = 0.2f, invert = true }); inputEntries.Add(new InputManagerEntry { name = kYAxis, kind = InputManagerEntry.Kind.KeyOrButton, btnPositive = "page up", altBtnPositive = "joystick button 5", btnNegative = "page down", altBtnNegative = "joystick button 4", gravity = 1000.0f, deadZone = 0.001f, sensitivity = 1000.0f }); inputEntries.Add(new InputManagerEntry { name = kSpeedAxis, kind = InputManagerEntry.Kind.KeyOrButton, btnPositive = "home", btnNegative = "end", gravity = 1000.0f, deadZone = 0.001f, sensitivity = 1000.0f }); inputEntries.Add(new InputManagerEntry { name = kSpeedAxis, kind = InputManagerEntry.Kind.Axis, axis = InputManagerEntry.Axis.Seventh, gravity = 1000.0f, deadZone = 0.001f, sensitivity = 1000.0f }); InputRegistering.RegisterInputs(inputEntries); #endif } void Update() { // If the debug menu is running, we don't want to conflict with its inputs. if (DebugManager.instance.displayRuntimeUI) return; float inputRotateAxisX = 0.0f; float inputRotateAxisY = 0.0f; if (Input.GetMouseButton(1)) { //lastAxis = new Vector2(Input.mousePosition.x, Input.mousePosition.y); //.Log($"MOUSE POSITION: x = {Input.mousePosition.x}, y = {Input.mousePosition.y}"); inputRotateAxisX = Input.GetAxis(kMouseX) * m_LookSpeedMouse; inputRotateAxisY = Input.GetAxis(kMouseY) * m_LookSpeedMouse; } inputRotateAxisX += (Input.GetAxis(kRightStickX) * m_LookSpeedController * Time.deltaTime); inputRotateAxisY += (Input.GetAxis(kRightStickY) * m_LookSpeedController * Time.deltaTime); float inputChangeSpeed = Input.GetAxis(kSpeedAxis); if (inputChangeSpeed != 0.0f) { m_MoveSpeed += inputChangeSpeed * m_MoveSpeedIncrement; if (m_MoveSpeed < m_MoveSpeedIncrement) m_MoveSpeed = m_MoveSpeedIncrement; } float inputVertical = Input.GetAxis(kVertical); float inputHorizontal = Input.GetAxis(kHorizontal); float inputYAxis = Input.GetAxis(kYAxis); bool moved = inputRotateAxisX != 0.0f || inputRotateAxisY != 0.0f || inputVertical != 0.0f || inputHorizontal != 0.0f || inputYAxis != 0.0f; if (moved) { float rotationX = transform.localEulerAngles.x; float newRotationY = transform.localEulerAngles.y + inputRotateAxisX; // Weird clamping code due to weird Euler angle mapping... float newRotationX = (rotationX - inputRotateAxisY); if (rotationX <= 90.0f && newRotationX >= 0.0f) newRotationX = Mathf.Clamp(newRotationX, 0.0f, 90.0f); if (rotationX >= 270.0f) newRotationX = Mathf.Clamp(newRotationX, 270.0f, 360.0f); transform.localRotation = Quaternion.Euler(newRotationX, newRotationY, transform.localEulerAngles.z); float moveSpeed = Time.deltaTime * m_MoveSpeed; if (Input.GetMouseButton(1)) moveSpeed *= Input.GetKey(KeyCode.LeftShift) ? m_Turbo : 1.0f; else moveSpeed *= Input.GetAxis("Fire1") > 0.0f ? m_Turbo : 1.0f; transform.position += transform.forward * moveSpeed * inputVertical; transform.position += transform.right * moveSpeed * inputHorizontal; transform.position += Vector3.up * moveSpeed * inputYAxis; } } void LateUpdate() { if (isRdpFixEnabled && Input.GetMouseButton(1)) { Vector3 axis = new Vector3(-(lastAxis.x - Input.mousePosition.x), -(lastAxis.y - Input.mousePosition.y), Input.GetAxis("Mouse ScrollWheel")); lastAxis = new Vector2(Input.mousePosition.x, Input.mousePosition.y); Debug.Log($"MOUSE X = {Input.mousePosition.x}, MOUSE Y = {Input.mousePosition.y}"); x += axis.x * xSpeed * 0.02f; y -= axis.y * ySpeed * 0.02f; Debug.Log($"X = {x}, Y = {y}, axis = {axis}, axis.x = {-(lastAxis.x - Input.mousePosition.x)}, axis.y = {-(lastAxis.y - Input.mousePosition.y)}"); //y = ClampAngle(y, yMinLimit, yMaxLimit); transform.rotation = Quaternion.Euler(y, x, 0); } } } }
So can you confirm that the problem with FreeCamera.cs is not fixable by changing the value of Active Input Handling? If so, then what course of action would you recommend to remedy the problem?
Could you please explain, what should I do in this situation? Do I need to implement some workaround or is there something already available that I'm missing or do I maybe need to install the "Input System preview.6-1.0.0" package? Any hints would be greatly appreciated!
using Unity 2019.3.11f1, RDP Input.GetAxis("Mouse X") return 0, always Input.GetAxisRaw("Mouse X") return 0, always
The problem is there but just with the legacy input system. I suggest switching to the new input system in which works like a charm. At least use the new input for the mouseAxis and the rest as it is (build with BOTH in player settings)
I have same problem with parsec! I can't look around with mouse anymore when I play my game with parsec. Unity 2020.1.17f1
Rene-Damm , karl_jones Ok now I use new input system but there is still a big problem with parsec when mouse reaches to the borders of parsec windows it stops working so I can't rotate my character completely (360)
I ran into this issue now with 2021.3.13 when using windows native RD client and Android app. If you play around with Cursor.LockState you can tell the cursor is technically locked on your android device, since you can't click or see hover animation on Unity Editor controls. But you can still see the mouse cursor and mouse/pointer delta doesn't work on edges of screen. Was this issue fixed?