Making a Multiplying Enemy?

I’m trying to make an enemy that multiplies into 3 versions of itself when I kill it.
It’s a slime enemy. So far I have an enemy that moves towards the player and just vanishes when hit by the players sword. I want 3 smaller copies to spawn moving in random directions when that happens. Any tips?

Is there some way to change the movement pattern of the copies when I instantiate 3 separate smaller versions ?

Before you destory the object use

for(int i= 0; i < 3 ; i++){

	instantiate(enermyObject,posistionAsAVector,angleAdsQuant);

}

Hi there

I don’t have a PC to hand so can’t write code here, but I answered a similar question here: C# setting instantiated prefab variables from another script. - Unity Answers

As you’ve correctly assumed, you simply need to instantiate 3 new enemies from a prefab, then set any properties you want on them. This might involve using the random.range function to pick random numbers to poke in. If all you want to modify is their initial position and rotation then you can just pass their new values into the instantiate function. However if you want to change more an that, check out my link

Hope that helps!