- Home /
Trying to set the "static" of game object to "false" when my player enters the collider?
Im trying to get an animation to play when my FPSController enters the collider I have set. I know it can work if "static" is set to false when my player enters and so far I have written this script. Obviously it does not work as I have yet to set my variable but I have failed to do so due to my noobness. Please help.
using UnityEngine; using System.Collections;
public class ExampleClass : MonoBehaviour
{ void OnTriggerEnter(Collider other) { if (other.gameObject.tag == "Player") { StaticBatchingUtility = false; }
}
}
Comment