Work done in December 2023
Animations:
To create my animations, I designed my own rigging tailored to the specific shape of my model. Since my model is humanoid, I employed Inverse Kinematics constraints to more easily simulate knee movements by controlling only the targets of these IK constraints.
Controlling the legs through their endpoints using the targets, I then aimed to manage my character's feet with these targets, requiring just one bone movement to control an entire leg. The only thing I needed for this was the ability to control their rotation. To achieve this, I added a Copy Rotation constraint on my feet to match their rotation with the targets.
For the upper body, I only needed a single bone for the Body. Given that the character is a bottle, this maintains the solidity of the object. I also required 4 bones for the bottle cap, with one serving as the parent of the other 3 to simplify the rotation of the assembly around a central pivot point. Additionally, 2 bones were allocated for the strap and 1 for the cap, facilitating the opening and closing of the bottle.
Unity and Shader:
An additional bone was added at the center of the Body bone, constrained in position, anchoring the Body bone. This latter bone was added after integration into Unity to accurately access the center position of the liquid container.
A significant part of animating this model involved animating the liquid inside the bottle. To synchronize with the character's actions, the liquid needed to easily expand and contract within the container. To achieve this effect more seamlessly, I worked on its animation via shaders, providing me with greater flexibility and options. I created a shader to consistently cut the liquid on the horizontal line, giving it a sense of physicality.
To achieve a satisfying result, I needed the position of the container's center to maintain the illusion that the quantity of liquid remains constant in the bottle, regardless of its orientation. The last added bone serves to access this position throughout all animations. Using the associated gameObject of the central bone, I utilize its position as a control point for the liquid's height. I modify shader variables within a script to alter its behavior based on player actions (control point height, liquid decrease and increase inside the container, wave speed, etc.).
In addition to the liquid shader, I implemented various particle systems in Unity to bring life to my animations in the 3D space. These particles include those appearing with each step of the player, droplet particles emanating from the player when pouring the liquid, and splatter particles appearing once the liquid hits the ground.
Demo Video
Shader Demo