side scrolling shooter, enemy AI help needed

0 favourites
  • 3 posts
From the Asset Store
Cannon Ball Shooter game assets for 2D bubble shooter puzzle game.
  • Hi, so My friends and I are working on a side scrolling shoot em up, all is going well, except for one thing, enemies that spawn during gameplay, won't follow the path that the pre existing enemies follow, I need to know how to get the newly spawned enemies to follow the same behaviour as the enemies that exist on start of layout, Thanks to a tutorial i found, I've got it set up so that the 2 enemies that are there when the layout starts find and follow a path to each waypoint, and this works, after they reach the last waypoint they repeat the cycle again, this works perfectly, however, enemies that spawn during gameplay, will only move to one waypoint and then stop altogether, i figured that using the condition and actions of "(basicEnemy)on created--> find path to (waypoint.x, waypoint.y)" would have them start the path, then the code i have for the two pre existing enemies for what to do when they arrive would take over and have the newly spawned enemies following the pathfinding cycle i have set out, but as i mentioned, they just come to a halt, anyone have any ideas? I've included an image of my event sheet for reference, really hoping it's a case of overlooking something minor.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I'm guessing the problem is with Owner and/or Waypoint_index instance variables. In events 4 and 7 you are picking waypoints based on these variables. So maybe when a new enemy is spawned, these variables are not set to correct values. Run your game in debug mode and check.

  • okay kicking myself now, turns out line 8 was the entire problem, i took away the line and made sure the enemy object was set to not rotate with pathfinding, and now they're working perfectly, thank you for your help, i would never have figured this out had i not run it in debug mode, so for that i thank thee

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