In a VR environement, I want the player to stay at the same position when I change the scale using “Set World to Meters Scale”. To do that, I get the player camera position before and after and I change the scale, compute the difference and move the player pawn accordingly.
It works, however “Set World to Meters Scale” is not executed until the end of the “Event Tick”. So it’s the same camera position before and after the “Set World to Meters Scale” node.
I am currently using a flipflop, but it’s a bad workaround and it shakes a lot the camera. I am looking for a solution to execute the “Set World to Meters Scale” node during the event Tick so the Camera position is updated before the next frame is computed.
did you ever figure this out?
Sadly no. It’s not the worst bug I have, so I’m just waiting.
For us – we do this is code since this is largely a terrible solution in UE4 at the moment. In our ULocalPlayer::CalcSceneView() function, we grab our WorldToMetersScale from a config’ed var on our GameInstance (set it how you would like…) and then do:
PlayerController->GetWorldSettings()->WorldToMeters = GameInstance->GetWorldToMetersScale();
and then finally do our Super() call.
To Amend this, you’re already too late if you’re trying to set this scale in the tick. The renderer is going to poll this value every frame if I’m not mistaken, which is why we end up doing it at the beginning of CalcSceneView
I just ran into this problem as well. I don’t see how your solution would help with getting keeping the camera position when the world scale changes. Could you please elaborate a bit?