How do I fix an enemies getting stuck for a few seconds before they move toward the player?

0 favourites
  • 13 posts
From the Asset Store
Basic Rounded Vector Geometry Player Design with Glow for 3 player games
  • My enemies sometimes will stand still after they spawn before either moving toward the player or getting stuck. Anyone know what to do?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Give them a push: dropbox.com/s/4tjnro8xiy4j6tm/sesame_instance.capx

    This worked but sometimes the enemies still stood still before coming after the player and I'm not sure why.

  • Is the delay happening when finding the path before the pathfinding path found triggers?

    You can visually fudge it by spawning them invisible, and enabling visibility on pathfinding path found.

    If they're still getting stuck after pathfinding path found and not moving, you might have some other events interfering with their movement or state.

  • Is the delay happening when finding the path before the pathfinding path found triggers?

    You can visually fudge it by spawning them invisible, and enabling visibility on pathfinding path found.

    If they're still getting stuck after pathfinding path found and not moving, you might have some other events interfering with their movement or state.

    Thank you this helped so much!

  • So it was just taking them a while to find a path? Consider doing something to ease the burden of the pathfinding algorithm. The A* algorithm should be very fast to the point it is unnoticeable on modern devices.

    Things like increasing your cell sizes or limiting the area and distance of pathfinding can do a lot for performance.

  • So it was just taking them a while to find a path? Consider doing something to ease the burden of the pathfinding algorithm. The A* algorithm should be very fast to the point it is unnoticeable on modern devices.

    Things like increasing your cell sizes or limiting the area and distance of pathfinding can do a lot for performance.

    Yeah it was taking a while. I have never messed with cell size. What would you say is an appropriate cell size for a viewport size of 463x270?

  • I always had trouble with the find path thing, but i think it was becasue of the way I was using the aceleration / deceleration

  • It's less about your viewport size and more about how much space you have between obstacles.

  • It's less about your viewport size and more about how much space you have between obstacles.

    Ok so if all my invisible walls and stuff like that are just mostly around the edges of my map I should make my cell size smaller then

  • No, a larger cell sizes requires less processing, but less resolution. For example if you make the cell size too large pathfinding might not be able to find a path through a small gap.

  • No, a larger cell sizes requires less processing, but less resolution. For example if you make the cell size too large pathfinding might not be able to find a path through a small gap.

    Ohhhhhh I get it now! ok thank you so much I'm going to go set my cell size to something bigger then

  • No, a larger cell sizes requires less processing, but less resolution. For example if you make the cell size too large pathfinding might not be able to find a path through a small gap.

    Ok so I tested it and doesn't have to big on an effect also the enemies seem to get stuck when the player goes in to the top corner. Here is an example

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)