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.

No alt text provided for this image


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.

No alt text provided for this image

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.

No alt text provided for this image

The result of putting this together ended with the following.

要查看或添加评论,请登录

Joshua W. Belangia的更多文章

  • ProjectMobi - Branching

    ProjectMobi - Branching

    To anyone who has followed my post in the past few months, things were flying at a pace that I thought the game would…

  • ProjectMobi AI – Two Discussions

    ProjectMobi AI – Two Discussions

    ProjectMobi - Blog Hello, Today I want to discuss what paths I am thinking about while making the AI for ProjectMobi…

  • Indy Progression

    Indy Progression

    Indy Progression ProjectMobi is underway, we are excited to move forward even if its just a little bit each day. This…

  • ProjectMobi Player Interactions

    ProjectMobi Player Interactions

    Today's message is about breaking down your actions into smaller pieces. I was looking into some old code that I am…

  • Game IDEA - The Approach

    Game IDEA - The Approach

    NoNameGaming Blog Below is a re-iteration of my blog Game ideas are in the masses. I can see after searching Unities…

  • React - Resume

    React - Resume

    So what if my resume is in the language they code in? Does that speak in volumes or data, render me this?

社区洞察

其他会员也浏览了