Friday, March 18, 2011

Zombie Alien Animation In Unity 3D a Final SUCCESS!

Finally SUCCESS!
After what has started to feel quite literally like forever with what was looking like no end and no solution in sight one of the member to Unity Answers Bunny83 gave me the solution to my ongoing character animation problem. For over a month now I had been trying to figure out how to stop my Alien Zombies imported from Max 8 into Unity 3D to stop from flipping over face down and doing their animations.

The solution, although complicated and a bit of a pain in the ass works, it actually Frakin works.
So what then was the solution you might well ask. Well it turns out that as suspected my Alien Zombie's rotation was wrong. So the way to fix it was to place my Alien Zombie inside of an empty game object and assign all the scripts to that game object. The Alien Zombie now being a "child" of that object. So the "ZombieAlienAIAnimation.js" java script needed to be changed in order to access the animations which of course are on the Alien Zombie inside of the "game object".

As you can see here the changes made to not only how my Alien Zombie is now implemented in the "Hierachy" but also the modifications made by Bunny83 now add an option in the "Inspector" view to add the "Model Animation". So that way all I had to then do was drag my "Child" Alien Zombie onto that "Model Animation" option. And it works. 

Finally after what has been like forever struggling with this blasted issue a solution. Thanks to Bunny who is absolutely brilliant for solving this problem.

Now on game play when my FPS player gets close the Zombie Alien I get a script error that reads:

Coroutine 'RunAttack' couldn't be started!

UnityEngine.MonoBehaviour:StartCoroutine(String)
$:MoveNext() (at Assets/WeaponScripts/ZombieAlienAI.js:100)
 
I know why this is too. I need to modify the "ZombieAlienAI" to better suit the type of attack strategy my Alien Zombie needs to perform as this script is basically the Robot AI script from the Unity 3D FPS tutorial. All I basically did was change the animations so I've got my work cut out for me on that. I will of course need to now make another animation for my Alien Zombie to do some sort of "Claw Attack" and get that to perform damage to my FPS player somehow. Right now I'm not sure how to do that. But hopefully we will figure it out.

No comments: