OnTriggerEnter2D and OnCollisionEnter2D not working
Both OnTriggerEnter2D and OnCollision aren't working. I've a block that writes "Collided" every time it collides with ground. It does write collided when the player object is turned off, but when it's turned on, it doesn't write "Collided".
Very hard to deter$$anonymous$$e what the problem is with so limited information, however it could be that if turning off another object makes it work, that you perhaps have a 1 collider over the other? and then the inner one cant collide with anything?
Answer by Map-Builder · Jul 30, 2017 at 09:35 PM
No collision are detected when a parent object is turned off. So there's a problem in you code.
Whenever it doesn't work it may come from you layer (for people coming to learn). But in your case if it writes collided when players is turned off then it does not collide with player.
Note: context not enough accurate, but check your code.
The collision is for another object. I have Cube1 (player) and Cube2 (TheOneWithCollisions). Cube2 doesn't detect collisions with the ground, but when I turn Cube1(theplayer) off, cube2 detects collisions, although it isn't a child of cube1. That's the problem, I don't understand what it has to do with the other object.
Your answer
Follow this Question
Related Questions
OnTriggerEnter getting called more than once 0 Answers
Horrible Collison 2D -- 1 Answer
How do I get collision and trigger to work? 2 Answers
Problems with using OnTriggerStay2d 0 Answers