Forum rules - please read before posting.

Spine Integration with Custom Scripts

Hello, I've been trying to use Spine with Adventure Creator but it's not working correctly for me. I've created the three scripts from the wiki: https://adventure-creator.fandom.com/wiki/Spine_Integration

I'm using AC version: 1.67.5
Unity 2018.3.5
Our animator is using the latest version of Spine, I believe it is 3.7

We have 4 directions for our player, UR, UL, DR, DL. Each direction as 2 animations GwenIdle and GwenWalk. In Spine, our animator only made two skeletons so I had him export each skeleton two times with the Idle and Walk for the respective directions.

In Unity, I chose a random Skeleton Data Asset from one of those skeletons and added it to the scene as a Skeleton Animation and then went through the AC Character Wizard, making sure the animation engine was set to Custom and named AnimEngine_Spine.

On all of my Skeleton Data Assets, I generated a Mecanim Controller. I'm not sure if this was needed but I wanted to be sure our clips were named appropriately.

I then went through the Player and set up the 2D animations and Spine setup panels that appeared in the Player Script. You should be able to see the images of the Inspector for my Player here: https://imgur.com/a/dEUY9hV

At this point, I believe I've done everything correctly? Under the Standard 2D animations, I simply used the Spine GameObject that is in the scene as the Sprite Child. Here's what happens when I try to play though: https://imgur.com/a/5bKS08x
You can see that it's quickly changing SkeletonData Assets. For some reason going UL works but the other directions don't.

When I take out the Sprite Child, the rotation also squishes the animation and it doesn't want to switch to our UL or UR directions: https://imgur.com/a/TlgBceG

I realize AC doesn't officially support Spine but I wanted to see if anyone could give me any guidance on what I've done wrong or if those scripts are out of date.

If any of those images/videos don't work for you all just let me know.

Thank you all!

Comments

  • Your images don't show the sprite child itself, and unless it's got the same name as your player's root (Spine GameObject (GwenDR)), it looks like your player's root is assigned as both your Sprite child and Skeleton animation fields.

    Your Skeleton Animation / Mesh Renderer / Mesh Filter components need to be on the child object - not the root which has the Player component. Move these to your child, and assign this child in the two fields mentioned above.

    It also looks like your scene is in 2D, in which case you don't want to have a Rigidbody or Capsule Collider component, since these are in 3D. The Character Wizard should only have added these if your game is set to be 3D, so check that your Settings Manager's Camera perspective field is correct. Remove these component from the root, and - if you need collision - replace them with Rigidbody2D and CircleCollider2D components. The 2D demo's player character, Brain2D, can be used as a reference.

  • I did notice that when I was going through the wizard it automatically set the game object as the root and the only child is the Sound child. Additionally, it also adds the Capsule Collider and Rigidbody. I did make sure to double check my camera perspective as well and it is set to 2D: https://imgur.com/a/aLD8Z7I

    Here is a video of the steps I took to create my player: https://imgur.com/a/wakhPhq

    Should I be using something else as the default object to create the player, like a simple sprite?

  • An update: Since I needed that root folder, I set up the animation engine to be Sprites Unity in the character wizard. Once it created the root and the child sprite, I changed the animation Engine to Custom and continued that way. It works now.

    Thank you so much, Chris!

  • I see. When using the Character Wizard, AC will attempt to guess the intended animation engine based on the kind of renderer you've supplied it. In this case, it's a Mesh Renderer, which is typically used for 3D characters (while Sprite Renderer is typically for 2D). Enforcing "Sprites Unity" or "Sprites Unity Complex" in the wizard should indeed resolve that.

    Be aware, though, that the Wizard is just a convenience - you can still just create a GameObject from scratch and attach the relevant components (Player, etc) and tag it as "Player" manually.

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.