Help with body forces in a boat script

I’m trying to rescript a boat script that uses body forces so that it floats in water, however anytime that I try and swap out body forces that allow the boat to interact with terrain water, the entire script breaks, this only happens when I change a body gyro for a body angular velocity so that I can steer, that the body velocity breaks and I’m unable to move or turn, swapping the body velocity works fine on its own. I’m not very experienced in programming so any help is welcome.
Here’s the original code
script.Parent.MaxSpeed = script.Parent.Settings.MaxSpeed.Value
maxspeed = script.Parent.MaxSpeed
script.Parent.BodyPosition.position = script.Parent.Position
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 + script.Parent.Settings.Acceleration.Value end
	
	script.Parent.Driving.Value = true
	
	script.Parent.BodyVelocity.velocity = script.Parent.CFrame.lookVector*value1
	
	script.Parent.Left.Value = false
	
	script.Parent.Right.Value = false

end

if script.Parent.Throttle == 0 then

script.Parent.Driving.Value = false

script.Parent.BodyVelocity.velocity = script.Parent.CFrame.lookVector*value1

script.Parent.Left.Value = false

script.Parent.Right.Value = false

end

if script.Parent.Throttle == -1 then

if value1 > - maxspeed then value1 = value1 -script.Parent.Settings.Acceleration.Value end
	
	script.Parent.Driving.Value = true
	
	script.Parent.BodyVelocity.velocity = script.Parent.CFrame.lookVector*value1
	
	script.Parent.Left.Value = false
	
	script.Parent.Right.Value = false

end

if script.Parent.Steer == 1 then

script.Parent.BodyGyro.cframe = script.Parent.BodyGyro.cframe * CFrame.fromEulerAnglesXYZ(0,- script.Parent.Settings.TurnSpeed.Value,0)

script.Parent.Driving.Value = true

script.Parent.Right.Value = true

script.Parent.Left.Value = false

end

if script.Parent.Steer == -1 then

script.Parent.BodyGyro.cframe = script.Parent.BodyGyro.cframe * CFrame.fromEulerAnglesXYZ(0,script.Parent.Settings.TurnSpeed.Value,0)

script.Parent.Driving.Value = true

script.Parent.Left.Value = true

script.Parent.Right.Value = false

end
end
image
And here is my code
script.Parent.MaxSpeed = script.Parent.Settings.MaxSpeed.Value
maxspeed = script.Parent.MaxSpeed
script.Parent.BodyAngularVelocity.AngularVelocity = script.Parent.CFrame

value1 = 0

while true do

wait()

if script.Parent.Throttle == 1 then

if value1 < maxspeed then value1 = value1 + script.Parent.Settings.Acceleration.Value end
	
	script.Parent.Driving.Value = true
	
	script.Parent.BodyVelocity.velocity = script.Parent.CFrame.lookVector*value1
	
	script.Parent.Left.Value = false
	
	script.Parent.Right.Value = false

end

if script.Parent.Throttle == 0 then

script.Parent.Driving.Value = false

script.Parent.BodyVelocity.velocity = script.Parent.CFrame.lookVector*value1

script.Parent.Left.Value = false

script.Parent.Right.Value = false

end

if script.Parent.Throttle == -1 then

if value1 > - maxspeed then value1 = value1 -script.Parent.Settings.Acceleration.Value end
	
	script.Parent.Driving.Value = true
	
	script.Parent.BodyVelocity.velocity = script.Parent.CFrame.lookVector*value1
	
	script.Parent.Left.Value = false
	
	script.Parent.Right.Value = false

end

if script.Parent.Steer == 1 then

	script.Parent.BodyAngularVelocity.AngularVelocity = script.Parent.BodyAngularVelocity.AngularVelocity * CFrame.fromEulerAnglesXYZ(0,- script.Parent.Settings.TurnSpeed.Value,0)

script.Parent.Driving.Value = true

script.Parent.Right.Value = true

script.Parent.Left.Value = false

end

if script.Parent.Steer == -1 then

	script.Parent.BodyAngularVelocity.AngularVelocity = script.Parent.BodyAngularVelocity.AngularVelocity * CFrame.fromEulerAnglesXYZ(0,script.Parent.Settings.TurnSpeed.Value,0)

script.Parent.Driving.Value = true

script.Parent.Left.Value = true

script.Parent.Right.Value = false

end
end
image

1 Like

Replying to this cause its been nearly a week without an answer, im trying to use body thrust now to move the boat, however whenever i run the script nothing happens, and the thrust in body script doesnt increase or change at all.
Here’s my script

while true do

wait()

if script.Parent.Throttle == 1 then

	script.Parent.Parent.MeshPart.BodyThrust.force.Vector3.new (0, 0, -1000000)

end

end
image