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

BodyGyro Facing the Same Place?

I'm trying to make a part with BodyGyro face another part, but whenever I try to edit the code of where it's facing (CFrame I'm Assuming), it just keeps facing the same way.

From the Wiki:

local b = Instance.new('BodyGyro')
b.maxTorque = Vector3.new(math.huge, math.huge, math.huge)
b.cframe = CFrame.new(0, 10, 0)
b.Parent = Workspace.Part

Anyone know what I'm doing wrong?

3 comments

0

b.CFrame = DiffPart.CFrame :o

0

No it's just he using a lower case cf it's b.CFrame = CFrame.new(0,10,0)

0

I tried that, It still doesn't work

1 answer

✓ Accepted answer

You have to use CFrame.Angles for a rotational CFrame, so

local b = Instance.new('BodyGyro')
b.Parent = Workspace.Part
b.maxTorque = Vector3.new(math.huge, math.huge, math.huge)
b.CFrame = CFrame.new(0, 0, 0) * CFrame.Angles(0, math.rad(math.pi()), 0)

That will turn it 180 degrees around on it's y axis, as if you stuck a hinge right through the part from top to bottom. Best way I could explain it.

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