- Home /
Mob spawn and start comming to me
Hi, i will spawn a lot of zombies and then i will they running to me.
i've the problem, the the mob prefabs can not have a gameObject (in this fall my character) to look at and run on it bevore spawn ...
i hope you understand what i mean and sry for my bad englisch :D
Sorry, no idea what you are talking about.
BUT, not all is lost. I'd like to offer some advise. Break your problem into smaller, more direct goals. Like "Spawn an Enemy" "Detect the Player position" "$$anonymous$$ove towards position". Stuff like that is easier to search and then you can glue it all together.
Answer by Kiloblargh · Feb 13, 2013 at 07:20 PM
You just have to give the player a unique tag, then assign the variable in Awake on the zombie's script.
var mmmBrains : Transform;
Awake()
{
mmmBrains = GameObject.FindWithTag("Player").transform;
}
Your answer
Follow this Question
Related Questions
Multiple Cars not working 1 Answer
Spawn help? 0 Answers
Spawn Script Not Working 1 Answer
How to make the clones of a zombie continue to clone? 2 Answers
Help with zombies Spawning 5 Answers