I’ve already half-posted this but since nobody has answered recently, I decided to give an update.
I’m working on a VR Module but I have to make the character rotation face the same way as the characters (vr) head.
The character gets an extra head, and two hand stubs for the vr helmet and the hands. The hands and head work perfectly, including my grabbing system.
The problem im having is that AutoRotate is off (it’s too fast, and you shouldnt have to turn your character with the thumbstick manually anyway) and when I turn with the code supplied, it turns faster the more I turn (y axis only!)
My code is hooked up to a remote event, which gets fired by a RenderStepped function inside a localscript.
The serverscript controls the head movement (listed with the “-- main problem!” comment.)
character.Humanoid.AutoRotate = false
character.Head.Transparency = 1
character.Head.CanCollide = false
humanoid.WalkSpeed = 10
RightHand.CFrame = (cam*CFrame.new(rh.p*2))*CFrame.fromEulerAnglesXYZ(rh:ToEulerAnglesXYZ())
LeftHand.CFrame = (cam*CFrame.new(lh.p*2))*CFrame.fromEulerAnglesXYZ(lh:ToEulerAnglesXYZ())
Head.CFrame = (cam*CFrame.new(head.p*2))*CFrame.fromEulerAnglesXYZ(head:ToEulerAnglesXYZ())
look = Head.Orientation
character.HumanoidRootPart.RootJoint.C0 = CFrame.new(0,0,0) * CFrame.Angles(0,math.rad(look.Y),0) -- main problem!
(The last line is the problem)
Warning: Video has extremely fast flashing lights, if you are sensitive I wouldn’t advise clicking on it.
Also, the video was recorded with virtual desktop inside Oculus, thats why my cursor is shaky lol
Anyway, if you can help, please do so!