playMaker

Author Topic: Enemy Help  (Read 1180 times)

Bainto

  • Playmaker Newbie
  • *
  • Posts: 36
Enemy Help
« on: July 05, 2018, 01:42:54 AM »
So the main section of my game is to keep the player on the path. If the player leaves the path an enemy will appear and kill the player but im trying to figure out the best way to both script and set this up... I want the enemy to stop if the player makes it back to the road and be destroyed (possibly with an effect i got if at all possible). Any questions for more detail i can provide to the best of my ability. ty in advance :D

Bainto

  • Playmaker Newbie
  • *
  • Posts: 36
Re: Enemy Help
« Reply #1 on: July 05, 2018, 01:44:03 AM »
ps. i have a script i just made for player death when the tagged enemy collides with the tagged player and to play a sound and restart the game. this script is on the player.

daniellogin

  • Full Member
  • ***
  • Posts: 215
Re: Enemy Help
« Reply #2 on: July 06, 2018, 05:00:34 AM »
Have a trigger outside the path that sets a global int to keep track if your player is off track or not. This will also allow you to change the same global int when the player exits the out of track area/enters the in track area.

Have the enemy comparing the global int to see when it switches. This will then set it in motion to start the attack sequence. Have the sequence watching the same int so when the player goes back on track it diverts the action (to cancel it).

The exact details of this will very much depend on how your enemy works and it's functions. Eg; Does it *poof* appear and disappear, does it start in a static location, does it need animation or will a simply tween work, etc. 

Bainto

  • Playmaker Newbie
  • *
  • Posts: 36
Re: Enemy Help
« Reply #3 on: July 06, 2018, 10:16:24 AM »
so i can place a few of the same around the map or if there is a way to make it "poof" appear a little around the player and maybe play a sound and chase till the char either gets on the road again or dies. The enemy has attack and run animations that i can add as well.