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

What does a BodyGyro do?

Asked by
RedCombee 585 Moderation Voter
10 years ago

I know that a BodyGyro can be used to make something face something else based on the CFrame, but I have also heard that it can be used to move parts along a pre-planned path. Are both of these true?

1 answer

Log in to vote
0
Answered by
Mystdar 352 Moderation Voter
10 years ago

I suggest looking at the Wiki before hand, should you not already have do so, this is copied directly off of the Wiki:

The BodyGyro object acts like a real gyroscope, it attempts to keep a fixed orientation of its parent relative to the BodyGyro's cframe. You can change the cframe to look at a certain spot, stop a brick from rotating, or track a player or object.

It seems from this you can make an object look at parts, however moving it doesn't seem relevant to BodyGyro, yet I may be wrong.

This is also from the Wiki, it seems to be the way (ie is the way) to make a part 'look' at or 'face' another part:

local part1 = game.Workspace.Part1 -- The part that will turn to face Part2
local part2 = game.Workspace.Part2
part1.BodyGyro.cframe = CFrame.new(part1.Position, part2.Position) - part1.Position

I realize if you have already looked at the Wiki this answer is fairly irrelevant to you, in which case, my apologies.

Ad

Answer this question