- Home /
Access Mecanim States and change animation
Hello everyone,
before going into details of my question I'll say what I'm trying to achieve, because I may be trying to solve this from the completely wrong angle!
So I would like my character to have multiple combat animations depending on the weapon he is holding.
I was thinking instead of having so many states and animations depending on the situation in mecanim to just have one generic state skeleton where I switch my animations:
I'm looking for a way to access Mecanim's state in order to change the animation of "Attack_1" state to whatever my character uses at the given moment.
I've seen the UnityEditorInternal.StateMachine but many people complain that it doesn't work on built versions.
Thanks in advance!
Answer by Roiku21 · Mar 24, 2014 at 04:53 PM
Ok, I had another go with it with clear mind and I found a good (add obvious :P) workaround to achieve that goal.
Instead of using states and trying to change the animation, I can use blend trees and I just switch the animations with a controlled variable.
The results are exactly the same!
Your answer
Follow this Question
Related Questions
Can you add animations from one rigged character to another using Mecanim? 2 Answers
Animation files (FBX) change when importing 0 Answers
Why is instantiated animator prefabs are not working properly? 2 Answers
Animation blending with mecanim in 5.2 2 Answers
Mecanim Tutorial lacking animation? 1 Answer