Hmm, How do i detect a Collision of an Object?

Hmm… I kind of forgot how to detect a Collision of an Object… Like a Simple Collision…

Well here’s what I tried.

	void OnTriggerEnter2D (Collider2D Coll){

		if (Coll.gameObject.name == YourBuff.gameObject.name) {
			print("Buff Me");

				}
		}

Here’s what I did.

I made a public GameObject named YourBuff. I dragged the selected object from my scene onto my YourBuff GameObject

Here’s what I’m Doing

I’m trying to make my GameObject detect Collision from YourBuff. But sadly… I think I forgot how to make a simple Object Collision detection.

Any help would be appreciated. I hate to be stuck on something like this…

Best way to remember something you forgot is to rewatch the tutorial :slight_smile:

If want to use multiple Colliders on the same GO. Refer this.