Need help coding collision detection to a destroy command.
im new to coding. I Have a unity tank game that im playing with and im making some of my own levels to teach myself. im trying to make some buildings that i made as game objects be destroyed by the projectiles that are fired from the tank. What i want it to look like is for the building to move down after being hit. I added a debug to see when the prefab (shell) hits the buildings but it only shows up in the console if my tank(player) touches the game object (building.)
This is not enough information to be honest but based on this alone I have a suspicion it might be to do with either your tags and/or layers.
We need to see the collision event code and the layer matrix at least before we can provide a solid answer, and each object's information in the inspector.
Your answer
Follow this Question
Related Questions
how do i delete a trigger when it is entered? 1 Answer
I can't figure out why a game object isn't being destroyed. 0 Answers
Unity 2D sorting item by color 0 Answers
2D: Destroy object with dynamic collider after exiting object with static collider 1 Answer
How to Destroy A GameObject when it enters any Triggers 2 Answers