Now add an empty game object to scene and position it at (25,0,-20). Call it zSpawn and next to its name in the inspector panel click on the multicolored box and choose the grey option so you can see the object in the scene. Now Add Component> New Script and name it Spawn.
Add Component>Text and change it to say “Score:” Change its transform values to match ours.
Now drag the zombie prefab and the barrel game object into the zSpawns inspector tab(See Below).
Hit play and zombies should be spawning every 3 seconds and making their way over to you.