Hey Guys, im trying myself on a first unity projekt: a 2D sidescroller game. However, i have some issues using a switch. I made a texture, added a box collider and a script that activates gameobject that were deactivated before OnTriggerEnter. Heres my code:
public GameObject target,target2,target3,target4;
public string tag = “Player”;
void OnTriggerEnter(Collider other)
{
if (tag == "" || other.gameObject.CompareTag(tag))
{
}
}
void SchalterAwake()
{
target.SetActive (true);
target2.SetActive (true);
target3.SetActive (true);
target4.SetActive (true);
}
The Problem is that my player doesnt activate OnTriggerEnter when he steps into the box collider, just nothing happens : / and thats really frustrating as i need this feature!
I hope you guys can help me : )