How would you blend a bool value in an Animator? (Specifically, change the spritemesh dynamically without both showing up)
I've recently started using Anima2D that is now free with Unity and I'm trying to push it to see what the limits are and what I can improve on. I have my animations set up so that each configures what sprites are visible. So, for example, I have multiple hand sprites that I toggle on and off depending on the animation's requirements (closed fist, turned to the side, etc). In the animation clip, I just add the property of whether skinned mesh renderer is enabled for every sprite that makes up the character. Within individual animations this is pretty straightforward and looks fantastic. The problem comes with blending and transitions.
I've noticed in my WALK -> RUN transitions (and vice versa) where one of the hands is different for each animation that there is a period within the transition where it glitches out and you can see both hands at once. Granted, you really have to find a "sweet spot" when tilting the joystick, but in a final game I think it would be an annoying glitch. Additionally, in a transition where a lot more changes occur in what sprites are visible, this could look pretty jarring. Also, I'd like to try adding slo-motion to a 2D game and this could break that effect as well.
One thing I tried that ended up looking even worse was to copy the state machine in another layer, change the animations of each state so that the original layer moved the bones and the new layer toggled the sprites, and then making the transition durations of the sprite toggle layer 0. Then I set the weight to 1 and the blend mode to override (additive didn't do anything). This time, instead of showing two hand sprites at once, a bunch of the sprites just went haywire.
So, does anyone have ideas on how to make it so that the sprites are toggled at the same time and no two are shown at once?
I'm not sure if I perfectly understand your problem, but it sound like you may be able to use Animation Events and/or State $$anonymous$$achine Behaviours. These basically let you call a function at a certain point in an animation. Use this function to change sprites. Since it's in the same function, it should be effectively the same time.
Your answer
Follow this Question
Related Questions
Object reference not set to an instance of an object (Unity 2D animation) 1 Answer
Mecanim state that keeps last pose? 0 Answers
How to make the animation of attack? 2D 0 Answers
Survival shooter - Video 2 - Movement Animation Not Working 1 Answer
Playing a sprite animation before an object is destroyed 0 Answers