I’m having issues with my BodyGyro rotating; I’m working on a Plane system that can rotate full 360 - It works, to some extent - After multiple spinning I’m met with the issue shown below:
Does anyone have any suggestions on how I can fix this?
PilotSeat = _index["Interior"]["PilotSeat"]
Mouse = game:GetService("Players").LocalPlayer:GetMouse()
Mouse.TargetFilter = _index["Main"]
local Speed = 0
local Tilt = 0
local Rotation = 0
_index["BodyVelocity"].Velocity = _index["Exterior"]["Base"].CFrame.LookVector * 0
while System do wait()
if Pilot ~= nil then
if (_index["Exterior"]["Base"].Position - Center).Magnitude > 1000 then
wait(2)
_index["Output"].Value = "OOB"
_index["BodyVelocity"].Velocity = _index["Exterior"]["Base"].CFrame.LookVector * 0
wait(1)
_index["BodyGyro"].CFrame = CFrame.new(_index["Exterior"]["Base"].CFrame.p, Center)
repeat wait(1) until CheckWithRange(0.1)
_index["BodyVelocity"].Velocity = _index["Exterior"]["Base"].CFrame.LookVector * 50
repeat wait() until (_index["Exterior"]["Base"].Position - Center).Magnitude < 100
_index["Output"].Value = "Idle"
end
end
if Pilot ~= nil then
if _index["Output"].Value == "Idle" then
local Tilt = ((((Mouse.ViewSizeY/2)-Mouse.Y)))/2000
local Bank = ((((Mouse.ViewSizeX/2)-Mouse.X)))/2000
_index["BodyGyro"].CFrame = _index["BodyGyro"].CFrame * CFrame.Angles(math.rad(Tilt * 15), math.rad(Bank * 15), math.rad(Rotation))
_index["BodyVelocity"].Velocity = _index["Exterior"]["Base"].CFrame.LookVector * 50
end
if PilotSeat.Steer == -1 then
if Rotation > 180 then Rotation = 0 end
Rotation = Rotation + 0.05
elseif PilotSeat.Steer == 1 then
if Rotation < -180 then Rotation = 0 end
Rotation = Rotation - 0.05
else
Rotation = 0
end
else
break
end
end