Making an enemy charge when you get too close

Dear: MattLB
How do I make an enemy attack me when I get too close? Then go back to it original position and idle animation when it gets back to its original position?
Sincerely: ViperShades

Please don’t include people in posts that haven’t already contributed to the thread.

There are condition that check the distance between 2 objects, and you’ll then need to add actions accordingly.

I suggest you use a Finite State Machine on the enemy to keep track of what it’s doing.

It’s fairly straight forward - just have a text variable on the enemy that holds the current state or action it’s doing.

Then have a series of events with conditions that check the value of that text variable, and sub events off that that perform the actions for it.

sorry i’m still figuring this stuff out. I’m new to all of this, but thank you for helping me. If I have any more problems may I ask you for help via email?

You could, but just keep in mind I may not always have time to respond quickly.

That’s alright. Me neither. :smile: