Destruction / breaking up individual parts of an enemy
Hey,
I'm new to unity and have been fine getting done what I've needed without too many problems so far, but I've been stuck for a couple of days now with this problem.
I have a sprite sheet with loads of different parts of alien ships, and I've got a system in place now that I can build new enemies with the parts and the scripts work well with sending messages (for instance destroying a part will destroy child parts, and damaging a part also sends damage to it's parent, so it's not disadvantageous for the player to destroy parts and not just always attack the main part).
Anyway, I wanted to create an effect where upon destruction of a part, the part is divided into several pieces (maybe 2-4) and sent off into space with colliders and gradual rotation.
The pieces can be hit with projectiles, bounce off other ships and the force of explosions etc. should send them away.
Initially I thought a particle system would be good for this, but the fact that the particles are made up of bits of another object, I'm unsure how I'd set that up. I don't know if there's a way I can dynamically divide up the sprite when it's destroyed, or if I'd need a few different sprite sheets of each part divided into pieces several different ways that I can use for the pieces.
Or alternatively because there's just a few pieces emitted right away, is a particle system even needed- should I just spawn some bits when a part is destroyed and send them off at some random velocity and rotation with collider and rigid bodies?