Por que quando Instanciar novos GameObjects não está adicionando tags a eles? [duplicado
Esta pergunta já tem uma resposta aqui:
UnityException: Tag: não está definido 1 respostausing System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Test : MonoBehaviour {
public float spinSpeed = 2.0f;
public int cloneTests;
public GameObject prefab;
private bool rotate = false;
private bool exited = false;
private void Start()
{
for (int i = 0; i < cloneTests; i++)
{
GameObject Test = Instantiate(prefab);
Test.tag = "Testing";
}
}
}
clonagem está funcionand
Mas não está adicionando a tag a cada GameObject. E como posso colocar todos os clones como filhos em outro GameObject?