Spine Animation & Unity2d
Hello hello,
This is a follow up from my last post about using "Spine" to animate sprites.
I wanted to show an example that I am currently using in project Mobi.
Below I have taken a few snips of how I have implemented the "skeletonAnimation" bone into something useful.
If you have already added Spine to your project you can access the "Bone" variable which I have named "AimBone". Once you have done this just assign it to your bone that was named within the Spine tool.
In my case I used this information to aim a laser gun at the enemy. So the next thing I implemented was a method to calculate the angle between me and what I was shooting.
Last I applied this angle as a rotation to the "AimBone". I also used this moment to define if my unit was facing left or right in order to get the correct angle.
The result of putting this together ended with the following.