How do I read values of mouse position between ticks?

How can I read values of x and y position of mouse between ticks?
it only update on the TICK.

Hi David,

Interesting question. Here’s my first thought on how to approach it:

Tick 1: UE retrieves/calculates mouse position. X:0, Y:0 → Save ā€˜last frame mouse position’

Tick 2: UE retrieves/calculates mouse position. X:4, Y:0, UE also knows what the mouse position was last frame, and does some math (Linear interpolation?) to figure out what the position between these two points are.

What’s the use-case for this?

2 Likes

Timer can fire between Ticks. But the updates are not divided evenly time-wise within the frame. One can have a 1000 updates, probably more. May not be suitable for time sensitive stuff.

What’s the use-case for this?

Also curious. Fruit ninja?

1 Like

what about FSlateApplication::Get().GetCursorPos();

Its value is updated continuously as the system processes input events, which can happen more frequently than the game’s tick rate.

1 Like

I have a 3D space UI and I have a tail from my cursor but it is always a bit behind the cursor so it is disconnected. The UI is the game but the hit do not register as soon as the Cursor is over so. So it feels like the game is not register at lower frame rate. The higher frame rate is less of a problem but still there.
cursorlagg

I tried with Timer Handle and printing the positions that how I saw that the Position was not updated between tick’s. I still learning UE.

Is there a blueprint function for ā€œFSlateApplication::Get().GetCursorPos();ā€?

Linear interpolation seems like it can work but be a bit off sometimes if I don’t get it right.

Or I can hide the fact by just hiding the Cursor and make a 3d one and have it move on tick but that will feel worse I guess.