Laser Destroy

As a challenge before Rick started doing it i tried like this. Is this method also ok ?

void OnTriggerEnter2D(Collider2D target)
{
if(target.tag == “Laser”)
{
target.gameObject.SetActive(false);
}
}

Hi zavy,

In many cases, there are multiple ways to make something work in Unity, and Rick cannot show all of them. If your code works, it’s a solution by definition. :slight_smile:

Has your question been answered?


See also:

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms