I'm trying to implement a simple pause button and have been able to pause all animations and motions of my various characters in the game except the clones.
I instantiate enemies a few seconds after loading level and they produce clones with names like "Orc_Mage(Clone)", etc.
I define the transform ...
private var orc_pikeman_Clone : Transform;
To find the game objects to "pause" I do this:
orc_pikeman_Clone = GameObject.Find("orc_pikeman(Clone)").transform;
Then I try to pause it's animations with this:
orc_pikeman_Clone.SendMessage("buttonPauseHandler", 0);
the enemy doesn't pause.
I should add what buttonPauseHandler does ...
function buttonPauseHandler()
{
Debug.Log( "buttonPauseHandler - EnemyOcrPikeman");
animation.enabled=false;
movementBeforePause.x = movement.x;
movementBeforePause.y = movement.y;
movementBeforePause.z = movement.z;
movement.x = 0.0f;
movement.y = 0.0f;
movement.z = 0.0f;
}
Do you have to do something special to pause the animation of a instantiated clone?
Thanks!
↧