How to track head's position in VR

I’m trying to make the camera move in it’s X,Y,Z values with rotation too, but I am unable to do so.

I’ve disabled headlocked and tried setting the CFrame value of the head trough GetUserCFrame, but you can only rotate your head. About the controllers, I can move them just fine but I don’t understand this snippet of code.

game.Workspace.Left.CFrame = (camera.CFrame*CFrame.new(LeftHand.p*HeadScale))*CFrame.fromEulerAnglesXYZ(LeftHand:ToEulerAnglesXYZ())
game.Workspace.Right.CFrame = (camera.CFrame*CFrame.new(RightHand.p*HeadScale))*CFrame.fromEulerAnglesXYZ(RightHand:ToEulerAnglesXYZ())

I don’t really understand these CFrame values, they aren’t equal to the actual position in-game. I’m really confused.

6 Likes

These are the positions of the hands relative to the head relative to the player’s camera.

1 Like