Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How to properly use body gyro?

Asked by 5 years ago

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.

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

1 answer

Log in to vote
1
Answered by 5 years ago
Edited 5 years ago

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)
0
Lovely stuff, thank you! Marmalados 193 — 5y
Ad

Answer this question