How can I create a water current?

Hello!

I’m new to the physics side of building.
In a game I’m working on there are some rapids. The visuals are fine, but the physics do not match it. Of course it behaves like regular terrain water, because it is.

What I want to do is have them pull the player along, like a water current would.
I’ve tried using conveyorbelts, but they don’t work underwater, and they mess up the animations. Also, a player has to be touching them for it to push them along, which means players not touching it aren’t effected. It’s a little below the water’s surface.

I guess I want to know how to make a conveyor without collissions, or somehow make it so that when the player enters the water they begin to be pushed along.
But they do need to be able to swim against it.

Does anyone have any ideas on how to do this? I’m stumped.

You can use a VectorForce placed inside the player. When the player is within a certain area script the direction of the force to push the player downstream.
I’ve used a BodyForce in my boat obby to create a current, but it’s been deprecated and tells you to use Constraints instead.

3 Likes

Adding to what Scottifly has said, you can use this terrain property (ReadVoxels) to read if the player is in the water terrain:

Let me know if you need help with the script part that will read voxels.

1 Like

I did end up having to use zones (Because there’s some water that’s still, not rapids) but that ended up doing it, and I figured out how to use VectorForces in the process. Thanks!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.