Hopefully I can explain this issue. So essentially, I am making boats that need to stay on a particular Y-Plane (aka, the sea level). I have been using BodyPositions, with the maxforce in the Y direction set to infinity, to do this. This works great until I try to run the boat up any kind of slant leading up out of the water. The boat can simply go up the ramp onto an island. Is there any way to restrict movement onto a higher Y-Plane indefinitely, even if there is a solid slope to move the model up? Feel free to ask questions about how my boat actually operates if that is relevant (because I'm not sure what is). Thanks in advance.
Drive Script (inside seat):
script.Parent.MaxSpeed = 40 maxspeed = script.Parent.MaxSpeed script.Parent.BodyPosition.position = script.Parent.Position--------------------DO NOT CHANGE ANYTHING! script.Parent.BodyGyro.cframe = script.Parent.CFrame value1 = 0 while true do wait() if script.Parent.Throttle== 1 then if value1 < maxspeed then value1 = value1 + 0.5 end script.Parent.Parent.Driving.Value = true script.Parent.BodyVelocity.velocity = script.Parent.CFrame.lookVector*value1 script.Parent.Parent.Left.Value = false script.Parent.Parent.Right.Value = false end if script.Parent.Throttle == 0 then value1 = 0 script.Parent.Parent.Driving.Value = false script.Parent.BodyVelocity.velocity = script.Parent.CFrame.lookVector*value1 script.Parent.Parent.Left.Value = false script.Parent.Parent.Right.Value = false end if script.Parent.Throttle== -1 then if value1<31 then value1 = value1+1 end script.Parent.Parent.Driving.Value = true script.Parent.BodyVelocity.velocity = script.Parent.CFrame.lookVector*-value1 script.Parent.Parent.Left.Value = false script.Parent.Parent.Right.Value = false end if script.Parent.Steer == 1 then script.Parent.BodyGyro.cframe = script.Parent.BodyGyro.cframe * CFrame.fromEulerAnglesXYZ(0,-.01,0) script.Parent.Parent.Driving.Value = true script.Parent.Parent.Right.Value = true script.Parent.Parent.Left.Value = false end if script.Parent.Steer == -1 then script.Parent.BodyGyro.cframe = script.Parent.BodyGyro.cframe * CFrame.fromEulerAnglesXYZ(0,.01,0) script.Parent.Parent.Driving.Value = true script.Parent.Parent.Left.Value = true script.Parent.Parent.Right.Value = false end end