I have code that checks for mouse movement. It highlights the objects beneath the cursor. Does it check all objects in the world everytime the mouse moves? The mouse is always moving. Is this a big performance hit? Should I avoid checking the mouse movement event?
Is this optimized by the Unreal Engine? Is there something I can do to optimize it?
Yes - all objects that are reachable and respond to the trace, even when the mouse does not move; assuming you Tick that part of the script. You can set up trace channels to include / exclude groups of objects. You can also adjust the distance. However, this is usually done for reasons other than performance since, as mentioned in the previous post, the impact would be unmeasurable and negligible.