- Home /
Anima 2d 4 direction character
Hello fellow devs,
Maybe this can is too long but Im trying to explain my workflow as clear as possible.
I am animating a character for a 4 direction movement in Anima 2D and wanted to know if someone has tried this before and can give me some tips.
I am working with a GameObject called Character that holds the collision and character controller. Then a Child Object that has the Animator. And then below this, 3 children with different sprites, each onw with an individual skeleton and respective rigs.
Up Player, Down Player and Side Player (this flips the Scale in X of the Character GameObject)
Every child has it's respective animations. For example Right Player, holds the IdleSide and WalkSide animation that move all of it's bones. Then the Up Player has it's own animations, and the same for Down Player. Now my question is this. How do I switch between the 3 bodies to exchange the animations?
I tried doing it in Mecanim for example, when I press Right to walk Right, Mecanim deactivates the gameObjects of UpDown and DownPlayer, then when I press up it deactivates Right Player and activates UpPlayer, etc. But somehow that's not working.
My question is, how do I do this? switch off one body, and activate the other?
Or am I doing this completely wrong? Another Idea I've had is instead of having 3 child objects with 3 different skeletons somehow reuse the same skeleton and bind it to several graphics and change their poses when necessary. Does this make more sense?
Sorry for the long post hope it was clear enough.
Answer by lanzanka · Oct 09, 2018 at 04:25 PM
Hi, @carloscervantes! Did you manage to solve your problem? I'm facing exactly the same and don't know what to do.
Answer by MNicholas17 · Nov 13, 2018 at 03:19 PM
I had this same problem although ended up using Spine2D instead of Anima.
The ideal solution would be to have one rig, but this is practically not possible because we have no way of setting a 'bind' pose for each of the directions making it incredibly difficult to switch between the positions the bones need to be in during setup if we want to tweak the art for each direction or alter the skinning. bind poses would be a great feature to add for this reason but as Anima is no longer being updated i wouldn't hold your breath.
The alternative solution having a skeleton for each direction is possible but not ideal as now each character is several times more expensive due to the duplicate bones. however this is what i went with in the end. as you create animations you can set in the animation to turn off the root bone of the other directions but this incurs a performance cost. while this setup works it does mean you can only have a handful of characters on the screen at one time.
to directly answer the question i would say have your 4 skeletons under one animation controller and for your walk up animation, turn off the other rigs in the anim clip at the start of the clip but remember to turn on the up rig. if you forget to turn on the rig then as you pay other animations everything will get turned off because nothing ever sets it to on. Hope this helps!
Your answer
![](https://koobas.hobune.stream/wayback/20220612160358im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Mecanim Animate Physics - When to use? 0 Answers
How to link 2 animations of different objects in Mecanim? 0 Answers
Set Animator Parameter based on move direction? 0 Answers
Animation motion on base layer does not play after additional motion on second layer 0 Answers
Changing speed of specific animation state, at runtime 1 Answer