hello, so im making a plane, the issue is that my body gyro just WONT WORK! My other plane has the exact same setup but doesn’t work.This is my plane script
local runservice = game:GetService("RunService")
local seat:VehicleSeat = script.Parent
local plane = seat.Parent
local turnSpeed = 2
local maxDistanceCheck = 25
local body = plane.Body
local force:BodyVelocity = body.Force
local gyro:BodyGyro = body.Gyro
local speed = 0
force.MaxForce = Vector3.new(math.huge, math.huge, math.huge)
gyro.MaxTorque = Vector3.new(400000, 400000, 400000)
local function GetNormal(part, normalId)
return part.CFrame * Vector3.FromNormalId(normalId) - part.Position
end
local function distanceCheck(distance)
local Bottom = body.CFrame.UpVector
local Blacklist = RaycastParams.new()
Blacklist.FilterType = Enum.RaycastFilterType.Blacklist
Blacklist.FilterDescendantsInstances = {plane}
local Result = workspace:Raycast(body.CFrame.Position, Bottom * distance, Blacklist)
if Result then
return true
else
return false
end
end
runservice.Stepped:Connect(function()
if seat.Throttle == 1 then
if speed < seat.MaxSpeed then speed += 1 end
if distanceCheck(25) == true then
print('true')
gyro.CFrame = body.CFrame * CFrame.fromEulerAnglesXYZ(0,turnSpeed,0)
end
local Thing = body.CFrame.LookVector * speed
force.Velocity = Thing
end
if seat.Throttle == 0 then
speed = math.clamp(speed - 1, 0, seat.MaxSpeed)
force.Velocity = body.CFrame.LookVector * speed
end
if seat.Throttle == -1 then
if distanceCheck(maxDistanceCheck) == true then
print("true")
force.Velocity = body.CFrame.LookVector * -speed
gyro.CFrame = body.CFrame * CFrame.fromEulerAnglesYXZ(0.1, 0,0)
else
force.Velocity = body.CFrame.LookVector * -speed
end
end
if seat.Steer == 1 then
gyro.CFrame = body.CFrame * CFrame.fromEulerAnglesXYZ(0,turnSpeed,0)
end
if seat.Steer == -1 then
gyro.CFrame = body.CFrame * CFrame.fromEulerAnglesXYZ(0,-turnSpeed,0)
end
if seat.Steer == 0 then
gyro.CFrame = body.CFrame * CFrame.fromEulerAnglesXYZ(0,0,0)
end
end)
please help, any help is appreciated!