Hi,
I am creating a few prototypes at the moment and I got stuck on the last one.
I am trying to allow a player to change his frame of reference from the world coordinate system to a moving one, like a vehicle.
So when a player moves around the world normally and then moves into, let's say a planes cargobay, his movements should now be relative to the vehicle instead of the world.
Just to clarify, I am not talking about steering a vehicle, I want to walk around a moving vehicle without falling off. In theory I just need to change the players reference coordinate system from world to an actors local one. But that seems to be rather hard in practice.
Here I have an image to illustrate the problem a bit

Is there an easy way to do this in unreals framework, or do I have to rewrite a few things in engine code?
What I've tried so far:
Things that could work, but I didn't try yet, because they all seem hacky:
Thanks in advance.
I am creating a few prototypes at the moment and I got stuck on the last one.
I am trying to allow a player to change his frame of reference from the world coordinate system to a moving one, like a vehicle.
So when a player moves around the world normally and then moves into, let's say a planes cargobay, his movements should now be relative to the vehicle instead of the world.
Just to clarify, I am not talking about steering a vehicle, I want to walk around a moving vehicle without falling off. In theory I just need to change the players reference coordinate system from world to an actors local one. But that seems to be rather hard in practice.
Here I have an image to illustrate the problem a bit
Is there an easy way to do this in unreals framework, or do I have to rewrite a few things in engine code?
What I've tried so far:
- adding velocity changes from the frame to all its children (so if the plane changes its velocity, we just add that to the players velocity and he stays in place, but that does not work for rotations[rotations could work with transformations, but that is also kinda hacky to do that on a top level of abstraction])
- Attaching the player to a vehicles root, which did't work at all, and all sorts of bad things happend
- Attach the player to a NOT root component of the vehicle blueprint and then pass all the movement inputs to this component to move it relative to the vehicle. (really hacky way of doing it, since you lose your movementComponents functionality )
Things that could work, but I didn't try yet, because they all seem hacky:
- build the whole thing in actor space (e.g inside a Blueprint with components moving around)
Thanks in advance.
Comment