Greetings…
i have a the script below attached to a empty with box collider and a sphere as a child to another object
if i enable the part of the script it will detect and destroy the parent object, but i cant get it to pause the animation thats attached to the parent, it keeps detecting the trigger as the object with the animation
please help, thanks…
void OnTriggerEnter (Collider other)
{
if (other.transform.parent.gameObject)
{
//Destroy (other.transform.parent.gameObject);
other.transform.parent.gameObject.GetComponent<Animation>() ["Run"].time = Random.Range (0, GetComponent<Animation>() ["Run"].length);
other.transform.parent.gameObject.GetComponent<Animation>().Play ("Run");
anim = other.transform.parent.gameObject.GetComponent<Animation>();
foreach (AnimationState state in anim)
{
state.speed = 0.0F;
}
}
}