How to fix this boat

I found this script in a free model ,it is using body gyro,position,velocity and it is working but the problem is that it is working outside water too,is there anyway I can resist its use to certain height and surface?

https://i.gyazo.com/9f20ff2ca08e350ac121d04308aabe6c.gif

https://i.gyazo.com/a3e150012610e3b896f641d500f1d219.gif

Or is there any good way to create a boat?

Seems to me its already doing what your asking for.

Ik,I just don’t want the flying part.

Honestly, I feel like you’d be better off using a different boat’s script which doesn’t use BodyPosition. Because while it uses bodyPosition it will always hover like that

Is there anyway to detect the surface below it?

You could use raycasts on each corner of the boat, check if there isn’t any water, then cancel out any velocity in that direction.

4 Likes