using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class WillSpawn : MonoBehaviour
{
public GameObject SpawnObject;
//public bool shouldSpawn = false;
public float spawnTime;
public float spawnDelay;
public int timestoSpawn = 0;
// Start is called before the first frame update
void Start()
{
InvokeRepeating("Spawn_Obj", spawnTime, spawnDelay);
}
// Update is called once per frame
void Update()
{
}
void Spawn_Obj()
{
SpawnObject= Instantiate(SpawnObject, transform.position, transform.rotation);
SpawnObject.tag = "Creature";
timestoSpawn++;
//if(shouldSpawn)
if(timestoSpawn == 1)
{ CancelInvoke("Spawn_Obj"); }
}
}
Hi,
I know GameObject tags can be assigned at run-time but my cloned objects don’t have the tag “Creature”. How can I go about instantiating them with this tag?
Additionally, how can I assign them an animator when they are instantiated?
Thank you!