How do I stop my boat from being an airplane?

I recently made a boat (Model). This boat works fine but I want it to only be able to rotate around the Y axis so it doesn’t go up/down when it hits a part. Here’s my script

seat = script.Parent.VehicleSeat
velocity = seat.BodyVelocity
bg = seat.BodyAngularVelocity

while true do
if seat.Throttle == 1 then
velocity.velocity = seat.CFrame.lookVector * 10
end
if seat.Throttle == 0 then
velocity.velocity = seat.CFrame.lookVector * 0
end
if seat.Throttle == -1 then
velocity.velocity = seat.CFrame.lookVector * -10
end
if seat.Steer == 1 then 
bg.angularvelocity = Vector3.new(0,-1,0)
end 
if seat.Steer == -1 then 
bg.angularvelocity = Vector3.new(0,1,0)
end 
if seat.Steer == 0 then
bg.angularvelocity = Vector3.new(0,0,0)
end
wait()
end

image

Before I hit the part I can drive around / only rotate the boat around the Y axis.

image
This is what it does when I hit a part.

image
Once this happened I can drive to the sky. How do I fix this? / How do I only let it rotate around the y axis so it can’t do that.

seat.CFrame.lookVector is the direction of where the boat is facing, and according to your code it is commanding the boat to move forward of it’s current direction, meaning, if it’s pointing up, it will go up.

A fix i can think of is taking out the Y value of that lookVector so there’s no upwards/downwards motion.

local Look = seat.CFrame.lookVector
local newLook = Vector3.new(Look.X,0,Look.Z)