Best Way to Make a Boat Float/Move?

So I’m trying to create a boat mechanic for a game. The boats need to steer and move as expected. I also want to sink the boat at specific levels as the boat gets damaged. I’ve looked at how some other people have done it and I’ve experimented myself. I haven’t come to a perfect solution yet, so I’d like to ask if anyone has advise.

I really wanted to make a single primary/root part at the center of the boat. This part would hold all of the mass and be the only part (except players on the boat) contributing to the mass and buoyancy. All other parts would be set to massless. All parts on the boat are unachored and welded together. However, there is one problem: massless has no effect on water buoyancy. I have tried messing with the density as well. The only way to achieve the desired result is to set CanCollide on all these parts to false. But then, the players won’t be able to stand on the boat. Is there any other way to make a part not contribute to an assembly’s buoyancy? I have tried to use collision groups to set to false between the terrain and boat parts, but it doesn’t apply to water. Is there some way to make the physics think the part’s mass & volume is 0?

Another method I have come across is to just use the real mass of all the parts in the boat, and to use this to calculate what forces need to be applied and where the boat will sit on the water. The problem with this is it’s obviously more tedious and prone to error. This will vary between every boat and will require formulas to calculate forces/density - which I don’t know where to begin with.

I’d rather use the first method if it’s possible. If not, I’ll have to figure out the second. Am I missing anything? Any advice? Thanks in advance.

6 Likes

Try scripting BodyMovers to create the exact movement system you’re looking for. This will likely be more simple than what you’re trying to do now, and it will give you greater control over the end result. Plus relying on water physics could backfire later if Roblox decides to update them again. Sorry if this isn’t the answer you were looking for, but it’s what I would do if I were in your situation. Good luck!

3 Likes

Are you using Roblox Water?

Massless = true; prevents a part from contributing to buoyancy. CanCollide = false; prevents contribution, but also contributes to gravity, so your boat will sink more.

8 Likes

Yes I am using Roblox water.

After some more testing, it seems that Massless = true prevents a part from contributing to buoyancy only if it is above the water surface. CanCollide = false prevents contribution to buoyancy only if the part is below the water surface.

My ideal case is to use both, but there’s the problem of players not colliding with the boat. I may make a feature request for this, maybe for water to be included in terrain collision grouping.

I’ve decided to just go with my second method for now, but slightly tweaked.

1 Like