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

BodyGyro won't work...?[1 more question]

bg = script.Parent.BodyGyro
while true do
wait(0.1)
bg.cframe = CFrame.new(script.Parent.CFrame, game.Workspace.NoobKing.Torso.CFrame)
end

It won't look at NoobKing. Why? What's wrong with it?

2 comments

1

Thanks for the CFrame.p part, but isn't BodyGyro supposed to have a 'cframe' property instead of 'CFrame'?

1

Sorry you're right, that's a typo

1 answer

The two parameters to the 2-argument CFrame.new constructor are vectors, not coordinate frames.

Either use .Position or use the position component of the CFrame, .CFrame.p. Interestingly they are the same length (in characters) so I have no opinion as to which is better style.


bg.cframe = CFrame.new(script.Parent.Position,
game.Workspace.NoobKing.Torso.CFrame.p );
-- For example use, both are shown
-- For good style, you should pick one or the other and use it
-- for both

You should also be tabbing your code properly



EDIT: Fixed typo. BodyGyro's target orientation is cframe NOT CFrame as I had typed previously

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