Water Flow Forces

Zones that push floaters around the water.

Basic Setup

Place a StaticFlow prefab around the water you wish to apply force in a direction

  • You can specify the direction of the force in the inspector, or you can drag the arrow that appears when the flow is selected.

    • The longer the arrow, the greater the force that will be applied in that direction.

  • Warning: The flow force direction uses global coordinates so rotating a StaticFlow will not change the flow direction.

How Flow Forces Work

Only Floaters that are inside a FlowForce Trigger and are in the water will have the FlowForces applied to it.

Once the Floater is no longer in the water, FlowForces will no longer apply.

By default you can have up to 10 overlapping FlowForces at one time

  • If you really need more, you can change the limit in the Floater.cs script

Included Flow Forces

  • StaticFlow pushes floaters in a single specified direction.

  • FlowRepulsionPoint pushes floaters away from the specified point. The closer to the point the greater the repulsive force.

    • Tip: You can make the MaxForce negative to pull floaters inwards instead of pushing outwards.

Creating Custom Flow Forces

You can easily make your own FlowForce scripts!

  • Make a new script that inherits from the FlowForce parent class instead of UdonSharpBehavior

  • Look at the FlowRepulsionPoint.cs script and grab the OnTriggerEnter and OnTriggerExit functions, or make your own.

  • Add the required GetFlowForce(Floater floater) function. This function should return the final Vector3 force that will be applied to the Floater.

Last updated