Pathfinding within room

Get help using Construct 2

Post » Thu Mar 07, 2013 3:24 pm

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.
Posts: 603
Reputation: 8,776

Post » Thu Mar 07, 2013 3:58 pm

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...
Posts: 83
Reputation: 2,668

Return to How do I....?

Who is online

Users browsing this forum: Google [Bot], mike20227 and 17 guests