gameObject.SetActive().... again

Hi guys,

I am new to Unity. Just installed it and following tutorial project #00 and I at the Collecting and counting video I am told to use

void onTriggerEnter(Collider other)
	{
		if (other.gameObject.tag == "PickUp")
		{
			other.gameObject.SetActive(false);
		}
	}

as a script to handle displaying objects.
It is not working (objects are not disappearing when ball hits them) and I don’t know why.
Any idea?

Try

void onTriggerEnter(Collider other)
 {
        print("Collider found");
        if (other.gameObject.tag == "PickUp")
        {
        print("Tag found");
        other.gameObject.SetActive(false);
        }
 }

And then we’ll check from there where your problem is.

It is OnTriggerEnter with a capital O!

1 Like

Dantus! You are my man! Thanks a lot :slight_smile:

Thanks Dantus, I had the same issue.

Also thanks @Divinux you helped teach me to step through each part and see what is going on.

1 Like