- Home /
Activating state upon mouse click in mecanim
Hey guys, I literally jsut want to transition from neutral mace to Mace Attack when the mouse is clicked, I have the neutral state which is activated upon runtime. Any help would be great, sorry for the nooby question but i really dont get this mecanim thing. Thanks guys, any scripting would be preffered in javascript
Answer by slavo · Oct 03, 2014 at 11:32 AM
You need to create bool parameter "Attack" in animator.
In Animator you make transition from "Neutral mace" to "Mace attack", that get triggerd when "Attack" is true. (You also need to set transiotion back depends on what you want to achive.)
You detected by script that mouse was pressed and use Animator.SetBool to set "Attack" to true. This trigger transition to "Mace attack" state.
To find out more about animation parameters and exapmle of source code you can look at AnimationParameters or Mecanim Tutorial