I’m going to ask a few questions to save me form asking a few for different subject. First question…Water Buoyancy its getting a real pain for me to program water buoyancy no matter what I try it any object with rigid body just sinks to the bottom. Another one is ripples, now I know this possible I found an old 2.0 example but that does not work anymore I even tried reprogramming it myself but instead it came out all wrong so I could use some help with that as well.
The only water interaction I witnessed was just a ‘trick’ regarding water collider trigger and an animation change for the character.
Simply put, never saw it implemented with physics, but in such case I would do it like this:
- object enters water
- my ‘afloat’ script instantiates an elastic joint, anchored to an empty gameobject’s rigidbodied prefab that stays at a constant height above water, and that follows the player
- the afloat script sets the elastic joint anchor to the player or object in the water
For the ‘trick’ solution, you just use a flag that tells wether the player is subject to gravity or not, for the most basic implementation.
Regarding water ripples, i think that the easiest implementation is a projector and an animated texture: http://variancetheory.com/animated-texture-builder/
- object enters water and triggers the water
- my ‘watersplash’ script instantiates a projector that uses the animated cookie at target’s feet