Majicpanda

I'm trying to find the best route for importing monsters into our game.

All monsters will have Idle and Walk but depending on what skills they have they would only require one of 4 attack animations from BowAttack, SpellCast, Melee, ThrowWeapon.

1 monster imports perfectly and I have set up the Mecanim state and normally you'd just make an Animation Override Controller and swap out the animations.

Is this the proper workflow?

Export Monster 1, make mecanim controller.
Export monster 2, make override controller and move it to the monster's Animator controller property and then manually select the override animation clips.

This would just require us to ensure we have Idle, Walk and well think out what skills each monster will have so that we make the proper animations so we don't try to trigger animations in mecanim that don't exist in the SkeletonAnimator.

Right now I'm getting error spam of "KeyNotFoundException: The given key was not present in the dictionary." which is line 97 of the SkeletonAnimator meaning I assume the exact same animation name needs to match across all monsters regardless of mecanim clip names.
Majicpanda
  • Postovi: 197

Mitch

Thats a good point. Should probably try to find a way to specify an "Override SkeletonData" for animation sourcing if a override controller is specified.
Avatar
Mitch

Mitch
  • Postovi: 978

Majicpanda

Do the imported clips have anything at all in them or are they simply placeholders to inform SkeletonAnimator what animation to play? I've just made an override controller for my main monster and did not swap any animation clips from my 2nd monster into it and it seems to be playing ok. It's litereally just using the main monster controller and all its animations clips but visually playing the correct spine animations.
Majicpanda
  • Postovi: 197

Mitch

they have the Events encoded into them and they have a dummy keyframe to mark the Duration of the original Spine animation so Mecanim loops them at hte correct time.
Avatar
Mitch

Mitch
  • Postovi: 978

niofox

I really need this. My controllers are fairly complicated. Unity lets me copy/paste the states/blendtress/sub-statemachines, but I have to set back up all of the parameters manually (unless anyone knows how to copy these?), and I've got 10 of them so far. Also if I change anything I have to duplicate this in all controllers.

Anyways, I want to say great job on the SkeletonAnimator! All of my tests so far have gone flawlessly :)
niofox
  • Postovi: 9

Majicpanda

Are you using Animation Override Controllers in unity?

If say you have Monster A and it has Walk, Idle, Attack1, Attack2 and Monster B with all the same animations but they are different in Spine.. you import both A and B into Unity which creates animation controllers and then create the override controller for B and base it off A and then drag all the animations for B into the override controller so that it uses the same Mecanim controller.
Majicpanda
  • Postovi: 197

niofox

Oh is that how it works? I'll have to try that, thanks :)

-- 07 Jan 2016, 19:17 --

I'm getting the same error: KeyNotFoundException: The given key was not present in the dictionary.
Do the names of the animations have to match exactly? Or is it the number of animations? Both? Perhaps the order?
niofox
  • Postovi: 9

Majicpanda

niofox je napisao/la:Oh is that how it works? I'll have to try that, thanks :)

-- 07 Jan 2016, 19:17 --

I'm getting the same error: KeyNotFoundException: The given key was not present in the dictionary.
Do the names of the animations have to match exactly? Or is it the number of animations? Both? Perhaps the order?
You definitely can't be missing any animations, but the controller should have automatically populated all the animations from your "A" for you into the list so that there won't be any missing.

If your mecanim controller enters an animation and is trying to call a specific animation then it definitely does have to exist. Do you have any holes in your override controller? I'm unsure of the internals but I would think that they need to be named identically because the animations still use the Spine data even though it's SkeletonAnimator.. right?
Majicpanda
  • Postovi: 197


Natrag na Unity