I have a Part
that has a BodyGyro
in it. The Part
is supposed to follow the orientation of the CurrentCamera
. Here is the script to do so:
script.Parent.counter.Force = Vector3.new(0,196.2,0)*script.Parent:GetMass()--antigrav, ignore local prev while true do local vec = workspace.CurrentCamera.CoordinateFrame.lookVector script.Parent.BodyGyro.CFrame = CFrame.Angles(vec.X,vec.Y,vec.Z) if vec ~= prev then print(script.Parent.Rotation) prev = vec end wait(0.1) end
The Part
moves, but does not follow the CoordinateFrame
of the CurrentCamera
. Could someone explain why?
I feel like you're thinking a bit too hard about this problem.
Camera.CoordinateFrame
is a CFrame
value, just likeBodyGyro.CFrame
is a CFrame
value.
All you have to do is set BodyGyro.CFrame
to Camera.CoordinateFrame
script.Parent.BodyGyro.CFrame = game.Workspace.CurrentCamera.CoordinateFrame