Pathfinding within room

0 favourites
  • 2 posts
From the Asset Store
Units do not overlap each other and use different ways if there are several free ways.
  • I've got another problem with my enemies. :D

    I have them spawning correctly, but they don't seem to want to move! I've got a 3x3 grid of rooms, and I need the enemies to only attack the player if they enter their room.

    I've got this so far, but no luck.

    I also would like the enemies to go back to EnemyHome_Spr (I put this in a container) if they leave the room but I am completely stumped on that one.

    What am I doing wrong? I can't tell if its the finding path part, or the moving along path part.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Without a .capx, it's pretty hard to tell, but here's some comments based on the screenshot...

    • why do you have the "For each enemy" in there - it seems unneccessary.
    • is the "on pathfinding path found" ever getting triggered? (Make the action associated with that event do something obvious - play a sound, update a textbox etc.)
    • Is the route failing to be calculated? (Add an "on failed to find path" event)
    • Do your room sprites fill the entire room? If so, the player is "colliding" with them the whole time they are in the room, and your "find path" event is getting triggered on every frame. There's never a chance for the enemy to follow the path if it's always getting recalculated...
Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)