Unity How to use a use a rigidbody2D and a isTrigger in 2D

Create a game object with a (Box)Collider2D component and check Is Trigger. Set the tag to for the object to “ladder” for example. In the script for your player/moving object that also has a Rigidbody2D component add the following method. Make sure the method is called 'OnTriggerEnter2D'

Player.cs
void OnTriggerEnter2D (Collider2D coll) {	
	if (coll.gameObject.tag == "ladder") {
		// do stuff
	}
}
Navigation
Print/export
Toolbox