I need help with making a boat that I can adjust the speed of. I copied some code here and there from online models but I can’t figure out how to change the top speed and acceleration of the boat. Here is the model I’ve made so far:
boat.rbxm (63.0 KB)
I tried changing the VehicleSeat’s Torque and MaxSpeed properties but it didn’t change the result. I also changed the BodyGyro’s MaxTorque but it didn’t work as well. I would really appreciate it if you can help. Thanks!
You need to script the boat’s thrust with the inputs of the VehicleSeat.
VehicleSeat MaxTorque and MaxSpeed values were only used on older versions of vehicles. The MaxSpeed allows your ‘speedometer’ to scale to the value of your speed on the screen, but the speedometer max value is set to MaxSpeed. This means that if you are moving at 100 studs/second and the MaxSpeed is set to 25 then it’ll only read 25. Same as if your vehicle only moves at 3 studs/second and the MaxSpeed is set to 100 then your speedometer scale will barely move.
If you are using Terrain water you can spin two propellers using HingeConstraints to move the boat through the water. I used this in my boat obby game. You can check out the boats in the test area to see how I used two props for steering.
I’ve also used a VectorForce for thrust and a Torque for steering in some of my other boats. These are explained here: Mover Constraints | Roblox Creator Documentation
can you send me the model of your boat ? i will mark your reply as solution if you do
I can’t remember if I built this before Roblox changed Terrain water physics again, so you may have to mess with the Density of Parts to make it float in the water so water is just below the inside bottom surface of the boat.
hey, it keeps on sinking. Can you check my boat to see how to change the speed pls? cuz i dont want to use physical propellers… thanks for your time
Just change the Density of my boat or the Part underneath it until it floats properly.
The top Part should be .5 or so, the bottom should be about 1.5. to keep it upright.
I can have a look at it later tonight, but first off try looking at the script I used to get the VehicleSeat inputs. (it is probably an old version of the script with a while true loop instead of waiting for inputs, but it should give you an idea of how to use those inputs to control what you are trying to do. Top speed would be the amount of Force you exert, depending on what Force you use, and there may be a Property in whatever Force you use to change the acceleration.
Here’s your boat, I just took out the Helicopter vertical movement sections of the script, changed the Density of the main Union to make it float, and moved the seat back so it wasn’t ahead of the window.
Spell’sBoat.rbxm (63.1 KB)
I also updated my 1st boat and added a simple scripted Constraint controlled boat. Tutorial Boat - Roblox
Hey, thanks so much for looking into the model. I just have one more thing to ask for. After you understand a bit of the script, do you know how to change the speed and the acceleration of the boat? That’s what I’ve been trying to do because I can’t seem to figure out how to adjust the speed and acceleration. Thank you for your time!
Never mind, I found out how I did it by changing the code into this:
function UpdateStep(delta)
--[[local drag = -BoatSeat.Velocity*DragFactor
drag = drag * drag
drag = Vector3.new(math.sign(-BoatSeat.Velocity.X)*drag.X,math.sign(-BoatSeat.Velocity.Y)*drag.Y,math.sign(-BoatSeat.Velocity.Z)*drag.Z)
local UpwardsForce = Vector3.new(0,RotorSpeed,0)]]
local ForwardsForce = BoatSeat.Throttle*MaxForceZ * BoatSeat.CFrame.LookVector
Force.Force = ForwardsForce * 10 --UpwardsForce + ForwardsForce + drag
BoatSeat.AssemblyAngularVelocity = Vector3.new(0,-BoatSeat.Steer/1,0)
end
The *10 part made it like 10 times faster. But do you know how to change the acceleration? Thanks!
Not too sure, you may have to put a loop in to start with a greater force and decrease the force when you increase speed so it doesn’t keep accelerating to an insane speed.
Right now, the boat can accelerate to its top speed in like two seconds. I know how to change the top speed in Boat>Vehicle Seat>Boat Server>Boat Ui>Boat Local where I changed the Force.Force = ForwardsForce * 10. The faster I want the boat to be, the more I multiplied the force. But the thing is after two seconds the boat stays at that speed. I want to be able to control how fast it accelerates, or how long it takes to reach its top speed. Can you look into the code/model please? Thank you!
New Boat.rbxm (63.1 KB)
I also found out that changing the variable MaxForceZ and multiplying Force.Force changes the speed of the boat as well, but not the acceleration. The variables are in script BoatLocal. Can you look into it please? If I can control the boat’s acceleration I will set your post as solution