|
Hi, I made a simple model using maya and exported as a FBX. It basically had two sets of animation , one is a walk sequence and the other a hit sequence. I made this model an enemy prefab, so that I could instantiate it, and set all the animation parameters in unity with an animation script attached. The problem is, if I drag and drop the original fbx model in the inspector, attach the same animation script and run the game the animations, both walk and hit, play correctly. But if I drag and drop the enemyPrefab the animation doest seem to work.I have searched but I have not found an answer. Can you please help me with it. I apolozise if this has been asked before. I have tried with Crossfade and Play with the prefab but to no avail. script c#: if (Vector3.Distance(objPlayer.transform.position,objEnemy.transform.position)<10.0f) { objEnemy.animation.Play("eHit"); } else { objEnemy.animation.Play("eWalk"); } Cheers wolfhammer
(comments are locked)
|
