How to create a new enemy type that's very similar to existing ones.

Hello,
I have a prefab created for my game that is full fleshed out and working to my specifications. Lets call this enemy A. Enemy A is a prefab, has an animator with many animations and states, and a script it follows. I would like to make a variation of Enemy A that is Enemy B. Enemy B will have different animations, and slightly different behaviors in its script, but everything else will be the same. Is there a way I can copy Enemy A and make these slight changes to Enemy B (change all animations to use Enemy B’s sprites, and change some values of the scripts). I tried creating prefab variants, but whenever I edited the animations in Enemy B it effected the animations of Enemy A. I am not sure what to do. Thanks.

So you need to create a new Animator. You can basically copy it from Enemy A but will need to make the sprite changes to it. So each Enemy would have an Animator but A will have EnemyA animator and B would have EnemyB animator. As for the different script values, that should be no problem, attach the script and change the values, they shouldnt have any affect on EnemyA script.

1 Like