How would I make a boat only drive on water?

Hello! I am making a boat, but one problem is that it can drive on land. How would i detect if it is NOT touching water?

2 Likes

You haven’t explained anything about how you are making your boat work.
I put 2 propellers on the back of my boats with HingeConstraints and use the VehicleSeat commands to change which prop is driving faster and which direction it turns.
Check them out here:
https://www.roblox.com/games/149461194/Boat-Obby-Now-with-new-boats

1 Like

I am using lookvector to move the boat forward and backword.

Why not try physical boat movement on water with props? It works very well and boats rock pretty realistically when accelerating, decelerating, and turning.

Sorry, I’m new to scripting. What do you mean by props?

Propellers that rotate actually work in Roblox water, as well as boats that have paddlewheels. Have a look at my obby and you’ll see that in the test area.

wait like- an actual propeller that you change the orientation of, and with a certain shape it will actually make things go forward?

It’s been available for quite a while.
Play the game’s test area and you’ll see.

Also, something that isn’t related to this topic- How much did you spend on advertising that game? It seems to be doing pretty well

It got a lot of advertising when a couple of YouTubers played it.
I’ve made some ads, but I don’t really spend a lot on advertising.

1 Like

Also, I’ve just played the game, does the boat move solely by the things spinning?

Yes!
The props are just 2 hubs (Parts) that have 4 blades (Parts) at an angle that use WeldConstraints to attach them to the hubs.
The hubs are attached to the Hull with HingeConstraints and the script just changes the HingeConstraint’s speed and rotation.

Would changing the blades’ cancollide property to false still allow the boat to work?

No, the blades have to interact with the water.
You can see it happen if you go into your Studio Settings and go into the Physics tab and click on the “Show Collisions” (I think that’s the name since I’m not in Studio at the moment) tab. It puts red spheres at points of collision during testing so you can see where items are interacting. Each Part in Water seems to have 8 points of collision that gives it it’s physical impact on the water.

Doesn’t seem to be working, the script in the union is

local part = game.Workspace.Blade.Union
local x = 0
while true do
	wait()
	x = x + 5
	part.Orientation = Vector3.new(x,part.Orientation.Y,part.Orientation.Z)
end

I am using a hinge constraint, connecting the back of the boat to the propeller.
this is the propeller: Screen Shot 2021-02-24 at 7.36.25 PM

But it’s a Union, so it’s technically one part and acts as one part.
My props have separate angled blades that each interact with the water.
Also make sure your boat Parts aren’t Anchored.

Why the heck are you CFraming a HingeConstraint? Make its ActuatorType a Motor and just use the AngularVelocity to rotate it.
CFraming a Part doesn’t let it act on other items physically, like when you CFrame a platform to move if a player is standing on it then they just stay in place and the platform slides out from under them.

I’m kind of new to these things, sorry. Would I do

game.Workspace.Blade.HingeConstraint.AngularVelocity = vector3.new(0,0,0) -- whatever the number should be

none of these things are anchored, I changed the actuatortype to motor.

Check out the wiki pages on these things:
HingeConstraint | Documentation - Roblox Creator Hub & HingeConstraint | Documentation - Roblox Creator Hub (measured in radians/second, so just put a number in there, not a vector3)

I’ve sent you a message with a model of a simple boat.

I would suggest use of the terrain functions to read the voxels of the area immediately under the boat. Alternatively, you can raycast and detect if water does or doesnt hit the ray.