Realistic Object Holding, Code Restructuring, and Throwing Behaviors. (Patreon)
Content
From the right: uses the handle. From the top: grab the top. From the left: cup the mug.
So now when Shinobu's hand approaches an object, she will calculate the most appropriate way to pickup the object depending on the direction that her hand is coming from and the orientation of the object.
Video 1 shows form above to pick up the ducky when it stands. (gonna move the thumb down a bit it looks a bit awkward).
Video 2 shows the other form above.
Notice how the ducky maintains local rotations more so as it is being picked up. It looks more realistic. The more hold forms I add for an object, the less rotational "sliding" an object will get as it gets locked to the hand. 2 to 3 are good. Also this is great for context because now I can bake out a perfect mug holding form with the handle. Or maybe raise her pinky when picking up a donut. Or maybe make only 1 way to hold a certain special item. Context.
I had to spend some time cleaning up the internal task permissions system so behaviors can mix. I changed the way her happiness meter works. Before it was a simple true or false boolean. But now it will be an integer from -1 to 2. If at -1 or 0 she will be angry, if at 1 or 2, she will be happy. This means that she can now be VERY angry or VERY happy at the value extremes.
One new behavior is now throwing objects at you when she is very angry. I made a throw animation, tied it to her logic and IK and voila. Video 3 shows it off. There are still a few bugs with her movement that are easy to fix but I didn't have enough time for this dev blog post. I will be revisiting her locomotion logic module. The next step is bugfixing this and modeling donuts for her eating behavior.