I have a 2D game. I have game objects that are made of a singular shapes with colliders and some that are made out of several shapes and included in an empty game object to which I have added a character collider. All the game objects have particle systems added and the single shaped game objects work as expected and explode onCollision, the multi shaped objects do not.
The explosions work as expected when using Play On Awake and Looping to Test them, but they do not explode onCollision. I have tried putting the particle system on one of the shapes inside the outer game object and then it shows an error Missing Component System, trying to access particle system for x object, which makes sense.
Within each game Object C# class I have the following methods:
private void OnCollisionEnter(Collision coll)
{
Explode();
}
private void Explode()
{
var exp = GetComponent<ParticleSystem>();
exp.Play();
GetComponent<Renderer>().enabled = false;
Destroy(gameObject, exp.duration);
}
The bombs are set to a rate of 0, to go off in one burst.
I have tried searching and cannot find the missing information required when using particle systems in game objects that are made up from multiple 3D game object shapes.
What am I missing?