- Home /
Question by
Blaze400 · Aug 06, 2021 at 04:02 PM ·
collisiongameobjectdestroy
How to delete everything but player object
Hi, sorry if I'm in the wrong place but how do I delete everything that touches an empty object that isn't the player it gets destroyed this is my code, if im in the wrong place or something like that please let me know.
code.png
(23.0 kB)
Comment
Give the player a player tag and change the if statement to
if(!other.gameObject.CompareTag("Player")
And you should be good to go
Your answer
Follow this Question
Related Questions
using Contains(gameObject) to find and destroy a gameObject from a list 2 Answers
How to Destroy a gameobject on collision 3 Answers
gameObject doesn't self-destruct after collision c# 2 Answers
Destroy on Collision? 1 Answer
Instantiate after collision 2 Answers