Changing Virtual Mouse Input Position from Script

Is there a way to change the position of the pointer of a Virtual Mouse Input component? I'd like to move the grahpics, rect transform and pointer from code to the actual position of my system cursor if I have one.

I've tried mouseVirtualInput.virtualMouse.WarpCursorPosition(systemMouse.current.position.ReadValue()); but it doesn't seem to do anything.

I can move the graphics and recttransform portion of it and make them follow my system cursor no problem, but the moment I move the virtual mouse it resets to the last position I left it in, instead of continuing from the system cursor's position.

same question~

Any updates?

use this InputState.Change(m_VirtualMouse.position, position);

3 Likes

[quote=“Vincent_LKB”, post:4, topic: 880381]
use this InputState.Change(m_VirtualMouse.position, position);
[/quote]
Thanks! this worked