So for “Watashi no Senpai Collection,” I wanted to create an animation where the player character dives towards the Senpai like they do in anime.
QueryChan has a bunch of animations built into the asset package already, but there wasn’t any single one that appeared to be what I wanted. I considered creating my own custom animation, but I knew it was going to be too much work considering I know absolute zilch about rigging and its already the final week for this month’s #1gam. I looked through the animation list provided by QueryChan and found two animations, a “win” animation and a “laydown” animation, that I thought might work out if I chained them together.
I edited the animator to create a kind of strange animation state progression. Essentially, I want to progress through the “win” animation and “laydown” animation and play them in a sequence to provide the illusion of the character jumping forward.
If I was running in real life, I would most likely do a little hop beforehand to gather my momentum for a big jump. In terms of what I had available with QueryChan, I realized that I could simply call the “win” animation twice in quick succession to give the illusion of the little hop.
Its pretty straight-forward. To create the tiny hop, I call the “win” animation while adding a very tiny forward and upward force. After the player lands, I call the “win” animation again and follow it with the “laydown” animation. Then after a small delay, I added a much larger forward and upward force for the large jump. UpdateJumpVelocity() is being constantly called in FixedUpdate(), so the private boolean triggerJump in UpdateJumpVelocity() and TriggerJump() is simply a flag to prevent premature changes in the force vectors.
In the end, I ended up with this:
It’s very rough looking and choppy. I’ll most likely tweak some of the variables as the hop distance and animation speed is really long, but overall, I’m pretty satisfied with the result.