playMaker

Author Topic: Spawned enemy help  (Read 1239 times)

Dionysu5

  • Playmaker Newbie
  • *
  • Posts: 3
Spawned enemy help
« on: May 01, 2017, 02:02:21 PM »
I am trying to spawn a zombie prefab and get him to follow the player still. But once he is spawned he does not know where the player is. What is the best way around this, to get the zombie to know where I am?

velketor

  • Junior Playmaker
  • **
  • Posts: 69
  • Multimedia Marathon Man
    • Shawn Kilian Portfolio
Re: Spawned enemy help
« Reply #1 on: May 01, 2017, 02:15:55 PM »
The way I do it is to put a tag on my player called "Player" and in my PlayMaker action I use "Find GameObject with Tag" and select the "Player" tag.  Now that PlayMaker has found the GameObject using the player's tag, you can store the GameObject in a GameObject variable.  Then, add a "Move Towards" action after the "Find GameObject with Tag" action and select the GameObject variable you just created.  This will make your zombie find the player by tag, store the variable and then follow that variable around the level.

Dionysu5

  • Playmaker Newbie
  • *
  • Posts: 3
Re: Spawned enemy help
« Reply #2 on: May 01, 2017, 02:27:01 PM »
Thank you, I needed someone to spell it out for me just like that. I will give that a shot.