- Home /
Track debug - Object dissapears after collision
Hello. First, sorry for language. Second - the problem. I have two object, player and enemy. The problem is when enemy touch a player object, or bullet object, it's suddenly dissapear. But it must doesn't - since there need two shots to remove them, and enemy even destroyes when colliding player object. I've tried to track enemy HP with debug.log and it's show that everuthing ok. So right now i try to find reason why enemys dissapears. Is any ideas or maybe is there any debug tools which can show me what happened at moment when enemy object destroys?
Do your have an OnTriggerEnter or OnCollisionEnter function for the enemy, bullet, or player gameobject? If so, can we see that code and the code which updates the enemy hp.
Are you using tags for the enemy, bullet, and player as well?
It would be really helpful if you'd show us your script. But like @ranso$$anonymous$$k said i think it must be a tagging problem. Do you use the line if (hit.collider.tag == "Player")
Your answer
Follow this Question
Related Questions
Destroying a prefab on collision with a cube? 1 Answer
Getting info about hit Object (Javascript). 1 Answer
Removing objects from GameObject array 2 Answers
OnCollisionEnter Collision not detected? 1 Answer
Unity 2D Colliders not Colliding 2 Answers