0
Answered

Cannot get enemy to stop following when near object

Jeff 4 months ago in Game Creator updated 4 months ago 2

My player has a device that makes an enemy peacefully follow them.  I want the enemy to stop following them once they get close to a car, where they are destroyed. The enemy has a trigger on him that makes him follow when hit by raycast. He follows well, but I cannot get him to stop when in proximity to the car.

Unity version:
2019.3
Game Creator version:
1.1.8
Answered

Conditions are not constantly checked. Check out our Tutorials sections. In particular, the Trigger section.

Oddly, I tried setting this up as a trigger on the enemy, but the collision with the car didn't work on the conditions / actions above. I ended up setting up a trigger on the player's collision with the area outside the car, at which time the enemy walked to the car and was destroyed (as if he got in), then the car drives away. That worked, for some reason.