Constant update of mouse x/y ?

Is there any way without using Event Tick to get a constant update of Mouse X/Y. Wanting to simulate a dragging mouse.

Why don’t you want to use tick? If you want to get the position every frame it seems like the obvious choice. Or if you are working in UMG you could use OnMouseMove, which is basically tick while your cursor is over the widget.

It’s to move a spawned actor. I figured it best to add an offset without altering it’s z location, just add mouse x & y to the offset but can’t figure out a good way to keep it updating. Actually I haven’t figured out yet how to stop it either, I assume either a while or gate should work.

I feel too much updating every frame is going to cause too much lag. Game is for iOS so must run minimally.

A timer might work for that, but the negative effect on user experience having unresponsive controls if you set a large delay might not be worth the theoretical performance saving. This could be an example of premature optimization, depending on what else you are doing on tick.

A gate would work, but even simpler would be a branch with a bool which is true when the user is dragging for example. If you put all that in a function, you can experiment calling it on tick, or a timer with a small delay and see what the performance cost is.

You could also only update the location only if it has changed greater than a certain amount. I’m not sure if the cost of checking that every frame would mean it saves much over not setting the location. I think you should get the system working first and then look deeper into optimization.

Found this tut and it’s not a bad idea … at 36:20 … Unreal Engine 4 Simple RTS Building Placement - YouTube

Using set actor location from and a delay to just go back on itself.

Thanks for the responses.

I tried the tutorial I mentioned and there r 2 problems.

  1. the loop doesn’t actually end,
  2. my mesh keeps doubling in size.

I sort of managed to stop it from going wrong…

The loop I changed to a branch with condition.

I’m not sure if it’s size or placement as my cam has no rotation so bit hard to tell, but got the location result then break and make leaving out either Z or X because together it goes sketchy.

I’m still not entirely sure I’m doing this in the right way, what I want to do is …

Option A … dragging an actor from a widget out onto the floor and while the button is still pressed to follow the mouse around.
option B … just spawn from line trace to hit to the floor from facing down camera point, then after drag around.

Thing is at the moment to set actor location using get hit result doesn’t want to update with OnPressed only OnClicked.

Could you post some screenshots of the relevant blueprints?

That’s a problem at moment because it’s all a mess and nothing is certain.