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
StaticFlowwill 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.csscript
Included Flow Forces
StaticFlowpushes floaters in a single specified direction.FlowRepulsionPointpushes floaters away from the specified point. The closer to the point the greater the repulsive force.Tip: You can make the
MaxForcenegative 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
FlowForceparent class instead ofUdonSharpBehaviorLook at the
FlowRepulsionPoint.csscript and grab theOnTriggerEnterandOnTriggerExitfunctions, 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