D
D
DANICH702021-01-27 11:12:47
Unity
DANICH70, 2021-01-27 11:12:47

How can I make all objects with the same tag show through the script (before that they are hidden)?

Here is the script:

using UnityEngine;
using System.Collections;
using UnityEngine.SceneManagement;

public class Destroy : MonoBehaviour
{
    public GameObject explosion; //игровой объект для взрыва астеройда
    public GameObject playerExplosion; //игровой объект для взрыва корабля игрока

    void OnTriggerEnter(Collider other)
    {
        if (other.tag == "Player")
        {
            
        }
        Destroy(gameObject);
        Destroy(other.gameObject);
    }
}

Answer the question

In order to leave comments, you need to log in

1 answer(s)
F
freeExec, 2021-01-27
@DANICH70

1. Найти все объекты с заданным тегом
2. Показать все объекты найденные в п.1

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question