Hi,
We’re using ProjectWorldLocationToScreen
to pin some 2D Slate graphics to actors on screen. But the camera projection seems to always be based on the last frame, resulting in 2D graphics that lag the actors on screen, especially visible if they change direction quickly.
Worse, we only react to specific changes, i.e. we only re-pin a 2D Slate graphic when the camera changes to another locked position. But even though the camera has moved, projecting will still be based on the old camera position, unless we wait one tick.
It seems that Unreal only computes whatever is necessary for ProjectWorldLocationToScreen
at the next tick.
Is it possible that all games with actor-HUDs actually have the position of the HUD delayed by one frame?
We’ve tried every example we can find, exhausted the AI, and dug through the engine source. ProjectWorldLocationToScreen
will simply not return a new projection for a moved camera until after the next frame.
Steps to reproduce:
- Within one blocking code execution:
- Move camera to a different position.
- Use
ProjectWorldLocationToScreen
to get the 2D position of an actor. - Observe that you get a 2D position based on the old camera position.
- Wait one tick.
- Observe that you now get a correct 2D position.
How do people solve this?
Per