How would I keep a boat aligned to the water?

Ok guys,
So I recently posted this topic:

It turned out that I have to use Mesh Deformation to make the boat react to the water. I was wondering, is there anyway to make a script or something that aligns the boat to the water? When I increase the wave size this happens:


When the water comes up the boat sinks into it and when it goes down, the boat feels like hovering. So is there anyway to align the boat to the shoreline at all the times?

Please dont give me the full script but rather link me to resources.

Thanks.

2 Likes

You could constantly change the y value to the y value of the shoreline.

1 Like

How would I detect the Y value of the shoreline though? Plus how would I align the orientation?

1 Like

First place a part and make it level to the shoreline. Anchor it and make it transparent, and turn can collide off. Then to find the Y value of it do part.Position.Y

But the thing is that we need big waves and the shoreline moves a lot. Is there anyway to kind of “weld” the part to the terrain water?

1 Like

Buoyancy and density are actually part of a few ROBLOX Updates recently released. You can control what objects can float on terrain water, and what objects can not float on terrain water.

What you will want to do is in Roblox studio select any part you want to float. Open the properties window and, categorized under part, find the property named “CustomPhysicalProperties”. Click the tick mark and you should be able to expand the property. You should then see five different properties one of which deals with density. All you would have to do from there is set the density to anything over 1 to make the part sink, or anything under 1 to make the part float. You might find yourself messing around with this quite a bit until you get your desired result.

2 Likes

You could try this instead of what I suggested.

1 Like

The problem is not the floating. The problem is the shoreline, Its not always staying on the shoreline but I will try this.

1 Like

This didnt help. I tried messing the values but nothing happened.


See how the boat appears to be floating above the water when the waves go down. I just want to align it to the waves so that it goes down and up with the waves and not just stay up.