- Home /
Can Mecanim/Animator be used to make Enemy AI's?
Hello everyone,
Is there a way to use the Animator by scripting inside a JavaScript to animate enemies? Could I call the different parameters for the animations to animate the enemies? If so, could someone show me a way to do it? Thanks, will really appreciate it.
Couldn't you just have variables that change based on what you, the player, is doing? Then do "if" statements to check if the variable is met, (true/false, distance < 5, etc.) Then animationName.Play(). It's tedious work, but not that complicated, just have to think about the actions you want the enemy to do and how the action is triggered.
Yes, but I was hoping someone would show me a small code to understand how the scripting works for mecanim.
Unity provides you with an example:
http://video.unity3d.com/video/7362044/unity-40-mecanim-animation-tutorial
They do scripting of their character in the video.
Alright, thanks anyway. I already looked at that project but I guess I would have to look at it closely this time.