I’m sure I saw this a few months ago, but I cannot find it with searches, and I cannot get the right syntax.
I want to delete a gameObject that has a particular tag. At the time I do it, I know there will be 1 object with that tag. I thought it was something like:
Destroy (gameObjectWithTag("gameMenu"));
Edit: Sorry, I posted then realised it should be in the scripting forum.
Edit 2: Solved, I’d had the right answer before, but a spelling mistake meant it hadn’t worked, so I’d tried everything else. The correct format is:
Destroy(gameObjectWithTag(“gameMenu”));
Спасибо ! Это работает для уничтожения старого объекта ( сейчас как раз RPG )типа Diablo делаю, и мне как-раз понадобилось создавать и подсвечивать новую target position и уничтожать старую target position