What scripts should i have on my three prefabs?

Hey guys,

I’m working through the AI section, I’ve just completed the swappable control systems video and my enemy is triggering the attack animations with a weapon range of 2 and the player character far away from it, I’m just wandering what scripts I should have on the character prefab and what scripts should be on the enemy?


A Character prefab needs the Mover, ActionScheduler, and Fighter, and if we’ve introduced it at this point, the Health and BaseStats (I don’t think we have yet).
The Enemy Prefab will inherit these (meaning they will be on your Enemy automatically, and will need an AIController.

These are the scripts i currently have on the character and the enemy. As soon as i hit play the enemy begins attack animations and eventually triggers death as its health value is going down over time, like its attacking itself.

Thanks for the quick reply too

The Enemy has a Player tag on it… so the AIController is picking up the first object with a Player tag it finds, and kills it(self). Create a tag Enemy in the tag manager if you don’t have one and change it to enemy.

1 Like

Privacy & Terms