local conn = game:GetService("RunService").Heartbeat:Connect(function()
turncoord = turncoord + (-seat.Steer * 6)
bodyforce.Velocity = bodyforce.Velocity:Lerp(prt.CFrame.RightVector * (seat.Throttle * seat.MaxSpeed), 0.1)
local primarycf = prt.CFrame * CFrame.new(Vector3.new(prt.Size.X/2,0,0))
local newerthingcf = CFrame.new(primarycf.Position) * CFrame.new(0,-5000,0)
local result = workspace:Raycast(prt.Position,newerthingcf.Position)
if result ~= nil then
local pos = result.Position
local normal = result.Normal
local newcf = CFrame.new(pos, pos + normal)
bodygyro.CFrame = CFrame.Angles(0,math.rad(turncoord),0) * CFrame.Angles(math.rad(-90 + (seat.Steer * 20)),0,0)
if (seat.Steer == 0 and seat.Throttle == 0) then
bodypos.Position = Vector3.new(prt.Position.X,pos.Y + 4,prt.Position.Z) + Vector3.new(0, math.sin(tick()), 0)
else
bodypos.Position = Vector3.new(prt.Position.X,pos.Y + 4,prt.Position.Z)
end
end
end)
When I am on the ground in spawn island the vehicle is always hovering over the ground, but when I in an island which is super high up the gravity is much less I assume and the vehicle goes upwards instead of hovering based on the normal. How do I fix the vehicle going upwards in a island super high up.