Download

Positional Tracking when player is parented to a moving object

I’ve got a scene similar to a roller coaster, where the player is parented to an object that’s moving along a track. As the player moves through the scene and changes direction, the positional tracking gets thrown off. Can anyone tell me how to correct for this?

I experienced the same problem (Where when you move your head forward, you move forward in X no matter what direction your “roller-coaster cart” is facing.)

Been a while since I looked at the project - But I remember updating to 4.4.1 and the problem being solved. (so troubleshooting step 1 - What engine version are you using?)

Hi and thanks for responding! I’m on 4.4.1. If I start with the VR Template and parent the player to a moving platform that’s animated via matinee, I get the same problem. I also see this problem with the Space Shooter VR template if you do a 180 from the starting position.

Which character template are you using?

I bet if you change it to use the one that has the camera attached/parented to the character’s head bone, it will do what you want (just make sure the anims don’t have involuntary head motions).

I was able to do the position tracking offsetting of a camera that “rides” inside of a blueprint like this:

It’s all hooked up to a tick event. That is actually a fix for a bug with the Vehicle Template in 4.4.2. When we updated it to include the interior for the Oculus, the tracking would be rotated based on the world instead of the car. Let me know if that helps.

Hi Alexander,

Thanks for the diagram, I may be wrong but it dosen’t appear to be the whole thing - what plugs into the “SET”?

Cheers!

Which Set are you referring to here?

Set Head Rotation is set as a combination of Device Rotation from the Get Orientation and Position and the Mesh’s World Rotation.

The Cam Origin is set in the construction script to the Internal Camera’s Relative Location. This allows you to reference the starting point of the camera.

Let me know if that helps or if you have any questions.

Hiya,

At the top of the diagram several nodes are plugged into a node called set - But from your screenshot I don’t know what’s at the other end of the graph -

Sorry, I’m new to scripting and don’t fully understand!

The Set node up top is “Set Head Rotation”. The white line coming out of the left of it is an “execution” line that is from a Tick Event. The Blueish dot is called a “Pin” and is linked to the “Combine Rotators” node that is adding the sedans rotation to the oculus rotation to offset it by the car’s turning. The execution running out from the right is just continuing the

If you are new to blueprint scripting, I would recommend checking out these resources:

Hey all. I’m the original poster, just chiming in to let you know the fix to my issue was a simple check box in the PlayerCameraManager blueprint, called “Follow HMD Orientation”. A big THANK YOU to Stephen Hess for pointing me towards it.