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?
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?
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.
2 comments
Thanks for the CFrame.p part, but isn't BodyGyro supposed to have a 'cframe' property instead of 'CFrame'?
Sorry you're right, that's a typo