Mensaje: Trying to Invoke method: SpawnShot.Spawn couldn’t be called.
public class SpawnShot : MonoBehaviour
{
public Health Player;
public GameObject Bala;
public float TiempoSpawn = 3f;
public Transform[] SpawnPoint;
private void Awake()
{
Player = GetComponent<Health>();
}
void Start()
{
InvokeRepeating("Spawn", TiempoSpawn, TiempoSpawn);
}
void Update()
{
}
void OnTriggerEnter(Collider other)
{
if (other.CompareTag("Player"))
{
int spawnPointIndex = Random.Range(0, SpawnPoint.Length);
Instantiate(Bala, SpawnPoint[spawnPointIndex].position, SpawnPoint[spawnPointIndex].rotation);
}
}
}