Hello, I’m working on a VR game where the player can enter / exit a vehicle, and I have a logic issue.
When the player is inside the vehicle, he controls its rotation with the camera (vehicle Z rotation = camera Z rotation)
Problem is, when the player enters the vehicle, he becomes a child of it. So there is a paradoxal loop where the vehicle can’t have the same rotation
than the camera, since everytime the vehicle rotates, the child camera is rotating with it.
I tried to set true the absolute rotation of the camera, but it doesnt work in VR. Right now,
I worked around by divided the vehicle into 2 different actors,
the first one is managing the physic / movement, the second actor is only to display the visual of the vehicle. When the pawn enters the vehicle it becomes a child of the first actor.
Every frame, the second actor’s position is set to the first actor’s position, and the second actor’s rotation is set to the camera’s rotation.
Even if this solution “works”, it’s not optimal, because the event tick is not precise enough (especially when I jump with the vehicle) and the visual of the vehicle are shaking.
Thanks for any help, sorry if it’s a bit confusing !