Boat wont stay upright / out of control

My jetski boat won’t stay upright and when you drive forward it goes sideways and spins in circles, same with reverse.

Here is the model, and the code, along with a video demonstrating what happens, not sure what I should do right now, any ideas?

local collectionService = game:GetService("CollectionService")
local runService = game:GetService("RunService")
local replicatedStorage = game:GetService("ReplicatedStorage")
local serverStorage = game:GetService("ServerStorage")

local function whileWaitLoop(boat, raycastParams)
		local startingPos = boat.VehicleSeat.Position +, 5, 0)
		local endingPos = boat.VehicleSeat.Position -, 15, 0)
		local ray = workspace:Raycast(startingPos, endingPos - startingPos, raycastParams)

		if ray and ray.Material == Enum.Material.Water then
			boat.AngularVelocity.Enabled = true
			boat.LinearVelocity.Enabled = true
			boat.AngularVelocity.Enabled = false
			boat.LinearVelocity.Enabled = false

local function boatStuff(boat)
	local speedValue = boat.SpeedValue
	local driversSeat = boat.VehicleSeat
	local raycastParams =

	raycastParams.FilterDescendantsInstances = {workspace.Terrain}
	raycastParams.FilterType = Enum.RaycastFilterType.Whitelist

		boat.AngularVelocity.AngularVelocity =, -1 * driversSeat.Steer, 0)
		boat.LinearVelocity.LineVelocity = speedValue.Value * driversSeat.Throttle
	whileWaitLoop(boat, raycastParams)

for _, boat in pairs(collectionService:GetTagged("Boat")) do


The video is here: Imgur: The magic of the Internet

Any help would be much appreciated :smiley:

Have you fiddled around with AlignOrientation, so it tries to keep a upright orientation?

no I haven’t. do you think you could point me in the right direction on how I’d use it to keep the boat up?

I would have a invisible part, that works as the “uprightPart”, and then have the boat try to alogn its orientation to that part all the time. You can read up on how to use AlignOrientation. There is more ways to do this you’ll see.

seems to keep the boat upright but now I cannot steer it? any suggestions?

You could do so the invisible part’s orientation in X and Z always will be equal to the boats. When you then try to AlignOrientation between boat and invisiblePart, then the boat will try to stay upright.

1 Like