/* void OnTriggerExit (Collider other){
if (other.gameObject.tag == “Player”) {
i = 2;
ani.SetInteger (“b”, i);
}
}*/
// Update is called once per frame
void Update () {
Mmhh… The code that handles the variable i would be useful to determine the problem. However, you may try to do something to correct the bug:
Put a Debug.Log("Glass") in the else branch in order to understand if it's executed.
You can try to use the technique in 1 outputting the value of ani (try to see if it's null or not)
If you're using MonoDevelop (or VS with VS tools), you may try to start debugging to inspect the problem
Finally, I’d advise you not to use GameObject.FindWithTag if it’s not necessary: if the GameObject you want to look for is present in the scene at the time you’re instantiating the GameObject that has this component, you can use a global variable to hold it and get a faster access to it.