I’m using bodygyro to let the player face a certain part and it works, but I want the player to KEEP facing the part during a period of time while hes moving. How do I achieve this? Right now hes sidewalking .
So you want to have it face the object without having the player have to move their controls.
What you can do is edit the C0 of the humanoidrootpart to lower torso to make it look like the player is facing a different way but letting the player keep the same controls.
You should keep autorotate on the and set the c0 to face the part.
Edit: This next part should be in a loop
local x,y,z = CFrame.new(rootpartpos, otherpartpos):ToEulerAnglesXYZ()
joint.C0 = CFrame.new(joint.C0.Position) * CFrame.Angles(x,y,z)
Honestly, I would avoid messing with the C0 Joint as what you’re essentially doing is offsetting the Torso from the HumanoidRootPart.
This can cause certain animations to be altered, or can mess with any potenial procedural animation as well.
Your math is spot on, but I would recommend either throwing it a heartbeat or a render stepped loop depending on how accurate frame-by-frame you want the character aligned.
As long as the Move call is using the relative parameter to the camera, or you’re simply using vanilla camera scripts, the character should continue wherever the camera is looking.
A body gyro is a BodyMover (a physics instance), it uses the physics clock to manipulate the properties of an instance.
For your use-case simply setting the CFrame of your character is way simpler and more reliable then dealing with physics which can be impacted upon by other external forces.