Question by
Rockyblack · Jun 22, 2016 at 07:57 PM ·
2dcollisioncollision detectioncollision2d
2D collision not working
I'm trying to detect when a box crosses a rectangle that is pretty much a line (9 pixels wide) and I've tried everything from OnCollisionEnter2D and OnTriggerEnter2D and tried putting the code in the box and in the rectangle and nothing is working.
Example:
function OnCollisionEnter2D (col : Collision2D) {
if (col.transform.name == "Box") {
Debug.Log("Box");
}
}
this is is the rectangle
Comment
In the future, could you please use the 101/010 button. See more information in the UA user guide.
Your answer
Follow this Question
Related Questions
Tilemap Collider problems 0 Answers
How would I implement collisions with my tile-based movement? 0 Answers
Can't make the player attack an enemy 0 Answers
Collision between two 2D objects. 1 Answer
Collisions not working in top-down RPG? 0 Answers