playMaker

Author Topic: Simple Enemy AI  (Read 2675 times)

YungPinoy

  • Playmaker Newbie
  • *
  • Posts: 2
Simple Enemy AI
« on: May 20, 2018, 09:27:07 PM »
I have an RTS/City Builder style game that I am working on. I am new to Playmaker and have been scratching my head on this. I'm wanting to accomplish this using the NavMesh utility.

Goal:
I want my enemy units to move towards a central location. I am able to do this using "set agent destination".
But what I would like to happen is, if the enemy is within a certain proximity of a friendly unit it changes it's destination to that of the friendly unit (inflicting damage) and then, if winning the fight, continues towards the central location.

Wolfride

  • Playmaker Newbie
  • *
  • Posts: 11
Re: Simple Enemy AI
« Reply #1 on: May 20, 2018, 09:45:25 PM »
This might give you the combinations you're looking for: EDIT- many ai packs are out of date now, check the feedback section.https://assetstore.unity.com/packages/tools/ai/easy-ai-for-playmaker-64781

A way that might work:
Parent a second collider to the enemy, make it as big as the range you want it to 'see' other enemies. Make it a trigger. When it collides with a friend/foe link it to a GLOBAL TRANSITION (so it will immediately stop what it is doing and do that instead) that checks what kind of enemy/friend entered its range via the tag of the collider. From here you can tell it what to do, and keep checking conditions to see if it is done doing it. Then return it to the state where it was going to a location.
« Last Edit: May 20, 2018, 09:48:36 PM by Wolfride »

YungPinoy

  • Playmaker Newbie
  • *
  • Posts: 2
Re: Simple Enemy AI
« Reply #2 on: May 20, 2018, 10:11:35 PM »
Thank you Wolfride. I appreciate the link to that asset. I will into that.
And I appreciate the advice. It sounds like it will work. I will play around with that.