Lets say I wanted this object to move across the water, without having to set points of where it has to go next, how would I be able to make it move freely in the water without it just standing still.
Is there a roblox feature for water flow?
Lets say I wanted this object to move across the water, without having to set points of where it has to go next, how would I be able to make it move freely in the water without it just standing still.
Is there a roblox feature for water flow?
No there isn’t as far as I know. You can use a BodyForce
or BodyVelocity
to add a force in that direction though.
You can find out about BodyForce
’s here: BodyForce | Documentation - Roblox Creator Hub
I used something similar in my boat obby.
Scripted it so that if the Part’s x Position is between certain values it pushes the Part (and the boat) to the right, then if it’s between a second set of values it pushes the boat to the left.
It simulates a water current pretty well.
Thanks for the answers, I have tried using bodyforces but there’s a lot of different turns in the river.
Also @Scottifly would that work for multiple turns or would I have to keep adding every single turn separately.
If your river is mostly along a straight line it would be pretty easy. Just make each zone have the x and z Forces required to keep it fairly centered in each zone.
I have it in a Part in the front of each boat. As the boat moves along the stretch of water it gets to a certain point on the x axis and the script recognizes it’s (for example) between an x Position of 50 and 70 so it puts a positive z bodyforce on the Part. When it gets to x > 70 the bodyforce goes to 0. Then when the x Position is > 100 and < 120 a negative z bodyforce is applied to the Part. As x gets past 120 the bodyforce is reset to 0 again.
You could do the exact same thing and change both the values of the x and z in the bodyforce to make it seem like there are curves in the river’s flow.