My boat keeps falling over.... How can i stop this behaviour

I’ve build a boat but it keeps falling over. Please see video:

Properties of the boat:



Screenshot 2023-09-27 121242

Here is my script:

local Seat = script.Parent.VehicleSeat
local Params = RaycastParams.new()
Params.FilterDescendantsInstances = {workspace.Terrain}
Params.FilterType = Enum.RaycastFilterType.Whitelist

Seat.Changed:Connect(function()
	script.AngularVelocity.AngularVelocity = Vector3.new(0, -1 * Seat.Steer,0)
	script.LinearVelocity.LineVelocity = 50 * Seat.Throttle
end)

while task.wait() do
	local sPos = script.Parent.VehicleSeat.Position + Vector3.new(0,5,0)
	local ePos = script.Parent.VehicleSeat.Position - Vector3.new(0,15,0)
	local ray = workspace:Raycast(sPos,ePos - sPos,Params)
	if ray and ray.Material == Enum.Material.Water then
		script.AngularVelocity.Enabled = true
		script.LinearVelocity.Enabled = true
	else
		script.AngularVelocity.Enabled = false
		script.LinearVelocity.Enabled = false
	end
end
2 Likes

I’m in no way experienced with physics, but I think it’s likely caused by:

  • Your boat being too light
  • Torque being too high
  • Boat being too narrow

To fix these issues, I recommend

  • Adjust physical properties of the boat (mass etc)
  • Reduce the torque
  • Increasing width of the boat
  • Lowering the center of gravity (this is a very useful one)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.