I am setting up a collision I. The editor where a 20s sprite character with a box collider and rigidbody (both 2d) can collide with a 2d box trigger collider. The unity collision matrix shows that it should register a collision, but my console message doesnt fire off when I enter or exit the collider (I have tried both the oncollisioneneter2d, and exit methods). The physics system doesn t seem to register the collision. In not at my computer at the moment but my code is basically OnCollisionEnter2D(Collider2D coll) { if(coll.gameObject.tag == "Player") { print("you have entered.") } } Print is another way of console.debug. the message isn't displaying to the console
Are you sure its the OnCollisionEnter2D failing and not the if(coll.gameObject.tag == "Player") comparison? Just do a print statement without the tag check and see if that works first.
@karl_jones That I'm using a trigger collider for the stationary collider, should I be using OnTriggerEnter2D instead? https://docs.unity3d.com/ScriptReference/Collider.OnTriggerEnter.html
@karl_jones That I'm using a trigger collider for the stationary collider, should I be using OnTriggerEnter2D instead? https://docs.unity3d.com/ScriptReference/Collider.OnTriggerEnter.html