- Home /
Question by
Bouldoro · Jun 23, 2018 at 11:37 PM ·
collisioncollision detection
Why wont OnCollisionEnter2D work?
Both objects have rigidbodies and colliders. They will in fact collide (my bullet pushes the other object away), but the debug won't work.
void OnCollisionEnter2D (Collision2D col){
Debug.Log ("hit");
}
Comment
Best Answer
Answer by MonkeyHood · Jun 24, 2018 at 01:14 AM
Are you using RigidBody2D and Collider2D? The 2D and 3D physics systems are completely separate and cannot interact.
Welp. That wasn't it, but your question had me delete components and scripts and redo everything and now it's working.
Your answer
Follow this Question
Related Questions
Avoid Player bouncing when colliding with objects 3D 1 Answer
Resize Array Based on Value 2 Answers
Check for collision while animating 0 Answers
object isn't detecting collisions 1 Answer
Destroying object on collision 3 Answers