Instantiated object won't collide with particles

I’m working on a flamethrower for a boss, and everything was going well until I tried to make the flamethrower destroy torpedoes launched by the player’s ship on contact.

I’ve already successfully made the flamethrower do damage to the player’s ship, and even to other enemy ships. I have also made the flamethrower destroy torpedoes that I manually placed in the editor.

The trouble seems to only affect torpedoes that have been instantiated at runtime.

Is the World Particle Collider unable to detect objects that have been instantiated at runtime?

Here’s the script that should be receiving the collision:

    using UnityEngine;
    using System.Collections;

    public class Destructible : MonoBehaviour {

	public float health = 100f;
	public GameObject explosionPrefab;
	
	private bool destroyed = false;
	
	void Start () {
	
	}
	
	// Update is called once per frame
	void Update () {
	
	if(health <= 0 && !destroyed)
	{
		destroyed = true;
		
		Collider[] nearbyThings = Physics.OverlapSphere(transform.position,200);
		foreach(Collider thing in nearbyThings)
		{
			thing.gameObject.BroadcastMessage("OnNearbyDestruction",gameObject,SendMessageOptions.DontRequireReceiver);
		}
		
		if(explosionPrefab)
		{
			Instantiate(explosionPrefab,transform.position,Quaternion.identity);
		}
		
		
		Destroy(transform.root);
		
		
	}
	
	}
	
	void OnParticleCollision(GameObject other)
	{
		if(other.tag == "Fire") health -= Time.deltaTime * 50;
	}
}

How are you manually placing the torpedoes? Duplicating scene torpedoes? It looks like your torpedo prefab is different from the ones you place manually - Unity doesn’t (or shouldn’t) make difference between instantiated objects and duplicated ones.

EDITED: I guess you should remove Time.deltaTime from the OnParticleCollision - this will make the damage proportional to how many particles hit the torpedo.

You must use Time.deltaTime in continuous events to have an fps-independent effect - but as far as I know this event occurs only once for each particle hit, what in conjunction with Time.deltaTime would produce an inverse fps dependency: the slower the frame rate, the greater the damage.

    void OnParticleCollision(GameObject other)
    {
        if(other.tag == "Fire") health -= 20; // tweak the damage value as needed
    }