WaterScript

This script must be attached to all water objects which vehicles and rigidbodies can interact with. These water objects must be on the built-in water layer, and their colliders must be triggers. If you are using mesh colliders, they must be convex in order to be recognized as volumes.

This script provides a basic simulation of water physics for vehicles and rigidbodies by using rigidbody.AddForceAtPosition at the locations of colliders on the rigidbodies. This creates an effect where parts of the car which touch the water will be dragged behind those which do not. This also means that areas where there are more colliders will be more subject to floating. The wheels of vehicles in this package have a greater collider density with their WheelEnhance colliders. Because of this, vehicles have a tendency to flip upside down when floating in water. Some people may consider this effect desirable; if not, just enable the ignoreWheelColliders variable.

Variables
Flow - The direction this water is flowing. Any vehicles and rigidbodies floating in the water will be pushed in this direction.

Ignore Wheel Colliders - Should the water ignore the wheel colliders of vehicles in order to prevent them from flipping upside down? Default is true.