Enemy navigating around the wall

EastboundEastbound Member, BASIC Posts: 1,074
edited November -1 in Working with GS (Mac)
I have an enemy that follows the player, and I want them to move around walls. However, without being able to see where the wall is that they collided into, I'm having troubles.

I don't need exact directions, I just want to hear how you did or might go about this? Thanks!

Comments

  • EastboundEastbound Member, BASIC Posts: 1,074
    No ideas?
  • GamexcbGamexcb Member Posts: 179
    I have one. You need the enemy to be able to calculate distance from the walls you could use trigonometry for that. An easier was is to let them hit the wall first and then decide how far and what direction to move in:

    Player
    -------------------------------------------
    <----------Enemy---------->

    Like that.
    Hope that helps!
    -Gamexcb
  • JGary321JGary321 Member Posts: 1,246
    Or use invisible actors. 4 of them. Called Left, Right, Up, Down.

    Place them as needed along edges & walls. So, right before it would normally hit the wall it will start moving up. Obviously you need to set rules in your actor. When collide with up Change velocity (or whatever move command you use), same with the other directions. That should at least give you some basic AI movement.

    -JGary
  • MoneyMaker100MoneyMaker100 Member Posts: 13
    can someone throw a little bit more light on how todo this. i understand the basic principle but my enemies move rules and the wall move rules keep getting mixed up, i really have been looking everywhere for an answer and am amazed that one doesn't really exist yet

    thanks in advance
Sign In or Register to comment.