Hi,
I was working on just a basic script to deactivate and reactivate a GameObject. My problem is that when I enter the trigger, it works perfectly fine, deactivating the GameObject, however going through the trigger a second time does not reactivate the GameObject.
Here is what I have:
using UnityEngine;
using System.Collections;
public class Weather : MonoBehaviour {
public GameObject WeatherObject;
void OnTriggerEnter(Collider other) {
if(other.tag == "WeatherTrigger") {
if(WeatherObject.active = true) {
WeatherObject.active = false;
}
else {
WeatherObject.active = true;
}
}
}
}
If someone can help me, that would be great. Thanks.