MrSkinny

We have a standard 2D humanoid character that needs to be able to aim/shoot in 360 degrees. I'm not exactly sure how to approach this with Spine/Unity.

I've seen solutions for this which manually rotate a bone (in this case arm) the desired degrees. This isn't a great solution for us because we also want to tilt the head and torso as they aim in different directions.

Currently we have animation states for 5 directions: down (-90°), angle-down (-45°), forward (0°), angle-up (45°) and up (90°). My hope is that we if the player wants to aim at say 20° we can set the aim animation track to an animation that is a 44% mix of the forward and angle-up animations. Or something similar that can achieve the same result.
MrSkinny
전체글: 6

Nate

Is your character a side view? 3/4? Top down?

For side view (and others), you can use constraints which will be easier than manipulating bones via code or combining animations at various angles. Take a look at our IK demo, check the Aim box, then move the red aim circle. See the latest spineboy project (in the Spine installation folder, reinstall to get the latest if your installation is old) for how it is rigged. One IK points the shooting arm at the aim bone and another IK points a bone at the hip at the aim bone. Transform constraints modify the arm, torso, and head to match that bone at that hip. Their mix is not 100%, which is what makes it look nice. Note the aim animation is just setting the transform constraint mixes (they are 0 in the setup pose).
사용자 아바타
Nate

Nate
전체글: 7881

MrSkinny

Nate, thanks as always for the reply. The character is side view and the aim in the IK demo is exactly what we are trying to accomplish. Cheers
MrSkinny
전체글: 6


다시 돌아감: Unity