Trouble Disabling Behavior [Solved]

fatsomania36

  • Posts: 15
Hi. I am making a space invaders game and I am having trouble with disabling a behavior. I have a behavior so when the player ship enters a region, the enemy ship fires back.  That part works, but I am trying to make it so that when the player leaves the region, the enemy ship stops firing at it. I tried doing a "When player leaves region" event and then "Disable behavior for actor". I have tried many things and none of them have worked. Does anyone know what I'm doing wrong? Here is a screenshot:






« Last Edit: February 08, 2017, 11:33:47 am by fatsomania36 »

JeffreyDriver

  • *
  • Posts: 2243
I'd do it with a boolean. When the player enters the region, switch the boolean to true, when it leaves, switch the boolean to false, then use that boolean to check if the enemy should fire or not.

fatsomania36

  • Posts: 15
I'm pretty sure I've already tried that, but, ironically, 2 minutes after I posted this I figured it out. I just did "Every 1 Seconds" if player is in region 15, trigger event "Fire". Otherwise, disable event "Fire". Thanks for responding so fast.