Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

How to make a working boat in new Roblox water terrain???

Asked by 6 years ago

I'm making a game need boats to move but I don't know how to make a boat can move in Roblox water terrain. I have try use some script but is not work and I don't know why. Can someone help me do this? Thank for all!

5 answers

Log in to vote
0
Answered by 6 years ago

Use a VehicleSeat with your boat model and it should work.

0
I have try to use VehicleSeat like you say but it still not work! Please help me. mrmrhuycf12vn 2 — 6y
0
Is it anchored? Launderer 343 — 6y
0
no, it use weld because if I anchor it, it can't move in the water mrmrhuycf12vn 2 — 6y
Ad
Log in to vote
0
Answered by 6 years ago
Edited 6 years ago

Try a VechicleSeat with your boat (like incapaz said) and then you have an option for welding:

a. You can use a welding script from the toolbox.

b. You can use weld constraints.

c. Simply put welds on the part itself.

Hope this helps!

EDIT:

So, the VehicleSeat is not working. This is probably the problem: The VehicleSeat should be referenced by a script.Here are the steps:

  1. Weld all the parts together.
  2. Create a BodyVelocity on one of the parts.
  3. Set the MaxForce to a high number.
  4. Add a VehicleSeat to the boat that is also welded.
  5. Add the script with the code below to the VehicleSeat:
01local seat = script.Parent
02local velocity = seat.Parent.BodyVelocity
03 
04seat.Changed:connect(function(property)
05    if property == "Throttle" then -- You are trying to go forward.
06        velocity.Velocity = Vector3.new(10, 0, velocity.Velocity.Z) -- You might want to change this depending on how your boat is rotated.
07    elseif property == "Steer" then -- You are trying to turn.
08        velocity.Velocity = Vector3.new(velocity.Velocity.X, 0, 10) -- You might want to change this depending on how your boat is rotated.
09    end
10end)

Hope this helps!

0
I have try use weld with my boat too but it still not work mrmrhuycf12vn 2 — 6y
0
Try using this script. It should work better. Pixelated_MC 33 — 6y
0
if this script doesn't work try mine, it will be posted soon. works perfectly on 7/26/2019 Starmarine5405 0 — 5y
Log in to vote
0
Answered by 6 years ago

treat it as actual water, the density of all parts of the boat will decide rather if the boat sinks of floats, i usually use bodythrust to move boats in water, and i definitely recommend using a body gyro so that it wont capsize

Log in to vote
0
Answered by 5 years ago

Ok so, all you have to do is add a VehicleSeat and add inside of it a, BodyGyro, BodyPosition, and a BodyVolocity then add a script inside the VehicleSeat and Paste/Type this in:

01script.Parent.MaxSpeed = 500
02script.Parent.BodyPosition.position = script.Parent.Position
03script.Parent.BodyGyro.cframe = script.Parent.CFrame
04value1 = 0
05while true do
06wait()
07if script.Parent.Throttle== 1 then
08if value1 < 41 then value1 = value1+1 end
09script.Parent.BodyVelocity.velocity = script.Parent.CFrame.lookVector*value1
10end
11if script.Parent.Throttle == 0 then
12value1 = 0
13script.Parent.BodyVelocity.velocity = script.Parent.CFrame.lookVector*value1
14end
15if script.Parent.Throttle== -1 then
View all 26 lines...

or take this model: https://web.roblox.com/catalog/03540884212/redirect

0
Thanks! This was very useful. I posted a modified version that is a bit smoother, but yours was a big help! BetaTrivus -2 — 5y
0
It didn't work for me. :( marioman1932 48 — 5y
Log in to vote
0
Answered by 5 years ago

Here, I made an updated version of StarMarine5405's script. The slowing down and reversing is smoother now.

I also changed some speed variables to fit my design, but those do not need to be changed.

01script.Parent.MaxSpeed = 20
02script.Parent.BodyPosition.position = script.Parent.Position
03script.Parent.BodyGyro.cframe = script.Parent.CFrame
04value1 = 0
05 
06while true do
07    wait()
08    if script.Parent.Throttle== 1 then
09        if value1 < 18 then value1 = value1+0.5 end -- The 18 should be around the MaxSpeed
10        script.Parent.BodyVelocity.velocity = script.Parent.CFrame.lookVector*value1
11    end
12    if script.Parent.Throttle == 0 then
13        if value1 >= 0.25 then
14            value1 = value1 - 0.25
15        elseif value1 <= -0.25 then
View all 32 lines...

Answer this question