playMaker

Author Topic: Prefab enemies and waypoints  (Read 1173 times)

wirejaw

  • Playmaker Newbie
  • *
  • Posts: 32
    • View Profile
Prefab enemies and waypoints
« on: June 28, 2021, 11:26:23 PM »
Hello PlayMakers.  I've encountered an issue with enemies and waypoints.  I have several enemies built as prefabs that need to follow a variety of waypoint objects, however I've realized the enemies (prefabs) will not recognize waypoint objects unless those waypoint objects have been set into global variables.  Is there a graceful and efficient way to handle this?  I'm hoping to avoid having to make every single waypoint in my game into a global variable.

Thanks much for any help!

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 6386
    • View Profile
    • jinxtergames
Re: Prefab enemies and waypoints
« Reply #1 on: June 29, 2021, 07:32:24 AM »
Hi.
you can have a 'Waypoint List' object.
on that, use a Array List (Array Maker)
You can add several way point lists if you wish.
the lists can be objects or vector 3 positions.

you can set this single object as a global.
or if you have a object that is in globals, then you can add a gameobject variable and you can get the reference by using get fsm gameobject.
Ecosystem might not work at the moment
here are direct Github Links to the custom actions :
https://github.com/PlayMakerEcosystem
https://github.com/jeanfabre


Join the PlayMaker Discord Channel!

wirejaw

  • Playmaker Newbie
  • *
  • Posts: 32
    • View Profile
Re: Prefab enemies and waypoints
« Reply #2 on: June 29, 2021, 10:38:43 AM »
Thanks djdino.  I downloaded the Array Maker package, but I'm not seeing any new actions and getting this error.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 6386
    • View Profile
    • jinxtergames
Re: Prefab enemies and waypoints
« Reply #3 on: July 01, 2021, 10:03:26 AM »
Hi.
The image is a bit to small to read.

But you might need to download playmaker utills
right after downloading Arraymaker
Ecosystem might not work at the moment
here are direct Github Links to the custom actions :
https://github.com/PlayMakerEcosystem
https://github.com/jeanfabre


Join the PlayMaker Discord Channel!

CuriousRodeo

  • Playmaker Newbie
  • *
  • Posts: 11
    • View Profile
Re: Prefab enemies and waypoints
« Reply #4 on: July 19, 2021, 08:10:11 AM »
You can also use the "Find Game Object" action on an FSM in your enemies prefab.
This searches the Hierarchy by String (or exact naming of an Object), or by tag, or both.

If your Waypoints are parented to another object, you will need to search for the parent object and then use the Find Child action for each of the child objects.

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 6386
    • View Profile
    • jinxtergames
Re: Prefab enemies and waypoints
« Reply #5 on: July 21, 2021, 09:03:00 AM »
Hi.
Its not advisable to use 'Find Game Object' During gameplay.
Only use this when loading scenes or during some breaks in the game.

for something like this its better the way i said in my earlier post
Ecosystem might not work at the moment
here are direct Github Links to the custom actions :
https://github.com/PlayMakerEcosystem
https://github.com/jeanfabre


Join the PlayMaker Discord Channel!

colpolstudios

  • Sr. Member
  • ****
  • Posts: 297
    • View Profile
Re: Prefab enemies and waypoints
« Reply #6 on: August 28, 2021, 06:23:40 PM »
Hi.
Its not advisable to use 'Find Game Object' During gameplay.
Only use this when loading scenes or during some breaks in the game.

for something like this its better the way i said in my earlier post

Would you possibly have time to explain more information in this regard please?

djaydino

  • Administrator
  • Hero Member
  • *****
  • Posts: 6386
    • View Profile
    • jinxtergames
Re: Prefab enemies and waypoints
« Reply #7 on: August 28, 2021, 07:52:45 PM »
Hi.
Find Game Object will look to all objects in your scene.
which is not an efficient way to do this during gameplay.
its ok to use @ start when scene gets loaded.
Ecosystem might not work at the moment
here are direct Github Links to the custom actions :
https://github.com/PlayMakerEcosystem
https://github.com/jeanfabre


Join the PlayMaker Discord Channel!