Overview
Aquafloat has multiple systems that work together to achieve water like effects.
Floaters
Points on a rigidbody that have gravity and water forces applied to them every FixedUpdate. You will find these on any object that floats on the water. The floater points have many customizable physics options and behaviors.
To save on performance, all physics calculations for floaters are only performed by the owner of the object.
Float Volumes
Float volumes are triggers that apply force to floaters in the direction of its surface.
Float volumes also trigger splash effects and sounds when objects enter the water. These effects and sounds can easily be customized for each Float Volume by adding splash particle overrides and sound effect overrides the the Float Volumes.
Flow Forces
Flow Forces are triggers that apply unique forces to floaters only while they are in the water. Set a few of these up in your water to create a simple river flow.
Gravity Zones
Gravity Zones are triggers that alter a Floater's gravity. Gravity Zones can be applied to Float Volumes to allow them to have unique shapes like ramps or spheres.
Aquafloat Controller
The Aquafloat Controller manages the options menus and the various effects caused by objects entering the water.
In the Aquafloat Controller, you can set the default splash behavior and volume for all your players.
There are also references to a Splash Particle FX script and a Sound Effect Player script.
Splash Particle FX
The splash particle FX script is a particle effect spawner. It maintains and re-uses a pool of particle effects to prevent memory leaks. Splashes take velocity and bounding box size of the object entering the water to provide the appropriately sized splash particles.
Sound Effect Player
The Sound Effect Player script manages the spawning of splash sounds around the player. It maintains a pool of provided audio sources to prevent too many splash sounds from happening at one time.
There is an option to adjust the maximum distance a player can hear a splash from to save on resources involving splashes the player won't be able to hear.
Whenever a splash is triggered, a random splash sound is chosen from the provided Sound Bank script. The volume and pitch of the selected splash is adjusted based on the intensity of the splash.
Aquafloat Seat
The Aquafloat Seat script utilizes VRC_Stations to attach players to moving objects. It has multiple options for stabilization and resizing players upon sitting.
Sitting in an Aquafloat Seat activates all Aquafloat Motors attached to it, giving the player direct control of the motors. The controls for the Motors can be set individually or deactivated for each Seat.
Aquafloat Motor
The Aquafloat Motor script applies force to a rigidbody based on its throttle, turn, and boost values. Motors can be configured in multiple ways depending on how you want the Vehicle to behave.
Aquafloat Seats are set up to send player throttle, turn, and boost input events to all attached Motors.
Upon activating a Motor that has Motor FX attached, those Motor FX will be activated and continuously updated with the Motor's throttle state.
Last updated