Changing behaviour script from human to zombie

Hi All,

I’ve just picked up Unity, and I’m trying to create a simple top down Zombie shooter where there are Civilians (blue circle sprite) and Zombies (green circle sprite) similar to Infectonator. The game starts off with one zombie and can infect Civilians who turn into zombies. The aim of the game is to stop the Zombies and you get a score based on how many Civilians survive.

I have a some basic mechanics nailed down, however I am struggling with changing the Civilian behaviour script.

Can anyone explain how I can get it so that the Civilian will pick up/switch to the Zombie Behaviour Script when it is infected? If it makes things easier the Civilians have no HP and are instantly infected upon contact.

The only viable way I can see of doing this would to possibly destroy the Civilian and spawn a zombie in its place which I really don’t want to do.

I apologize if this has already been answered somewhere else, but I have been unable to find anything after looking for over an hour.

I’ve figured out where I was going wrong and merged the two scripts together with a bool of “infected” to control which part of the script to follow.