I’m attempting to change the orientation of a welded object using a BodyGyro and a CFrame. It’s not really working, because it won’t go past a certain orientation. I can’t seem to find anything on the DevForum at all. I’ve attached a GIF to help.
(Imgur if it doesn’t load here.)
script.Parent.BankAngleChanged.OnServerEvent:Connect(function(client,manueverSpeed,direction)
script.Parent.PrimaryPart.BodyGyro.P = manueverSpeed
if(direction == -1) then
script.Parent.PrimaryPart.BodyGyro.CFrame = CFrame.Angles(math.rad(script.Parent.PrimaryPart.Orientation.X),math.rad(script.Parent.PrimaryPart.Orientation.Y),math.rad(script.Parent.PrimaryPart.Orientation.Z+10))
end
if(direction == 1) then
script.Parent.PrimaryPart.BodyGyro.CFrame = CFrame.Angles(math.rad(script.Parent.PrimaryPart.Orientation.X),math.rad(script.Parent.PrimaryPart.Orientation.Y),math.rad(script.Parent.PrimaryPart.Orientation.Z-10))
end
end)
script.Parent.PitchChanged.OnServerEvent:Connect(function(client,manueverSpeed,direction)
script.Parent.PrimaryPart.BodyGyro.P = manueverSpeed
if(direction == -1) then
script.Parent.PrimaryPart.BodyGyro.CFrame = CFrame.Angles(math.rad(script.Parent.PrimaryPart.Orientation.X+10),math.rad(script.Parent.PrimaryPart.Orientation.Y),math.rad(script.Parent.PrimaryPart.Orientation.Z))
end
if(direction == 1) then
script.Parent.PrimaryPart.BodyGyro.CFrame = CFrame.Angles(math.rad(script.Parent.PrimaryPart.Orientation.X-10),math.rad(script.Parent.PrimaryPart.Orientation.Y),math.rad(script.Parent.PrimaryPart.Orientation.Z))
end
end)