- Home /
Better cursor control,Control cursor position
I'd like to have more control over the cursor in my game, so that I can lock it to a specific position or move it to a different position.
From what I've read it seems I can't really do that with users actual cursor position - since it's OS driven and results in a bunch of compatibility issues if I try messing with those things, so I'd rather avoid that!
I had the idea of making a UI element that acts as a cursor, taking position info from (I'm using InputSystem) /delta and just locking the actual cursor (Cursor.lockState = CursorLockMode.Locked;) and not using it at all.
But I'm kinda stumped on how to make something act exactly like the mouse would normally?
I'm guessing something with PointerEventData & ExecuteEvents ? But I'm struggling to wrap my head around it all - any help appreciated! :),I'd like to have a little more control over the cursor in my game, so that I can lock it to a specific position or move it to a different position.
From what I've read it seems I can't really do that with users actual cursor position - since it's OS driven and results in a bunch of compatibility issues if I try messing with those things, so I'd rather avoid that!
I had the idea of making a UI element that acts as a cursor, taking position info from (I'm using InputSystem) /delta and just locking the actual cursor (Cursor.lockState = CursorLockMode.Locked;) and not using it at all.
But I'm kinda stumped on how to make something act exactly like the mouse would normally?
I'm guessing something with PointerEventData & ExecuteEvents ? But I'm struggling to wrap my head around it all - any help appreciated! :)
Your answer

Follow this Question
Related Questions
Reacting to Mouse animation... 2 Answers
swiping with mouse input 0 Answers
Mouse position to Isometric Grid Tile number 1 Answer
aiming with animation 1 Answer
make an object glow when mouse over 3 Answers