Hello
I have a problem with my Instantiate when I go inside the collider and spawn the object unity will block it i muss remove it with the TaskManager.
Here is the script but i don’t understand why it crash:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class CarrelloSpawner : MonoBehaviour
{
public GameObject carrello;
public GameObject pos;
private void OnTriggerEnter(Collider other) {
if (other.gameObject.CompareTag("Carrello")) {
//for (int i = 0; i < 1; i++) {
Instantiate(carrello, pos.transform.position, pos.transform.rotation, pos.transform);
//}
}
}
}
Thanks