playMaker

Author Topic: Ennemies Find GameObject Player at spawn[SOLVED]  (Read 1325 times)

Mike45

  • Playmaker Newbie
  • *
  • Posts: 9
Ennemies Find GameObject Player at spawn[SOLVED]
« on: December 15, 2016, 10:26:18 AM »
Hi, i'm learning playmaker and i read that using the action Find GameObject too often affect performance.
But I want to instantiate ennemies regularly in the scene and each of them will use FindGameObject when they spawn to find the player, is it still the right way to do it ?
« Last Edit: December 16, 2016, 07:38:45 AM by Mike45 »

mdotstrange

  • Hero Member
  • *****
  • Posts: 555
    • Can't code? Who cares! Make games anyway!
Re: Ennemies Find GameObject Player at spawn
« Reply #1 on: December 16, 2016, 03:30:22 AM »
You can use "Set game object" on the player to set it as a global game object variable- then just make the enemies look for that variable-
Indie game dev and instructor at the Strange School. Learn Playmaker at the Strange School!

Mike45

  • Playmaker Newbie
  • *
  • Posts: 9
Re: Ennemies Find GameObject Player at spawn
« Reply #2 on: December 16, 2016, 07:38:07 AM »
Thank you I will do that.