Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How to properly use body gyro?

So I understand that body gyro is used to make an unachored part face a certain way. I currently use a code that follows:

local BodyGyro.CFrame = Character.HumanoidRootPart.CFrame

But all it does it face in the face direction as the HumanoidRootPart, how would I change it so I can face towards that part rather than face in the same direction? It’s for a pet simulator game.

1 comment

0

Maybe you are looking for CFrame.new(vector3 pos, vector3 lookAt) and just put it in a loop of some sort

1 answer

✓ Accepted answer

you'd use the CFrame.new(vector3 position, vector3 lookat) constructor to look at an object with BodyGyro.

BodyGyro.CFrame = CFrame.new(script.Parent.CFrame.Position, Character.HumanoidRootPart.CFrame.Position)

1 comment

0

Lovely stuff, thank you!

This discussion is preserved as it was. New answers, comments, and votes are closed.