I have tried this a number of ways but not much success. when my rocket hits a ship to blow it up, I destroy the gameobject and instantiate a ragdoll version in it’s place to blow up. but I get at least 2 instances of the ragdoll and sometimes even more. how can I limit it so that just one gets instantiated?I triple checked that only one item tagged “grenade” is hitting the boat because when I changed the tag nothing happened so it is the only thing tagged. and I am not instatiating two rockets, just the one. I’ve tried setting the trigger collider on the boat off upon impact but it was no help
void OnTriggerEnter (Collider other) {
if(other.tag == "Grenade")
{
Destroy (gameObject);
Instantiate(prefab, transform.position , transform.rotation);
}
}
}