How do I create roaming AI on a set path continuously?

0 favourites
  • 6 posts
From the Asset Store
Fully commented source code/event sheet & sprites to create a space shooter game
  • Hi, I've been trying (and failing) for days to create AI that moves along a set path continuously. I have a few different AI that need to do this but I started trying to get one to work. The AI that im trying to get to move needs to move from left to right on a loop. Ive tried literally every type of movement behavior and event and just can't figure out how to do it. The main method ive used is pathfinding. When uisng pathfinding on my AI i can get it to move from left to right fine. But when i try to get him to move from left to right and then back to left again it bugs out and moves left and stays there dancing around on the spot.

    If anyone can help me with this issue it would be greatly appreciated

    Thanks

    Liam

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Is this what you're after ?

    https://dl.dropboxusercontent.com/u/108 ... nding.capx

  • Thanks for replying and yes thats exactly what Im after

    I am having one issue with the example you sent me. I have dupicated everything from the example you sent to me into my game (changing what needed to be changed of course). The NPC in my game isnt moving continously, it is once again moving to the first point and staying there (This was with the movment location sprites on the top layer, two layers above the NPC). I then moved the Movement sprites on to the same layer as the NPC and it moved to a different sprite (the one it was closed to) and stoped still again. The same thing happend when i moved the movment sprites to the bottom layer.

    Once again thanks a lot for posting, the file you sent did help a lot despite me still having one issue.

    Edit: I did try to post a link to an image of my event sheet so that you could see what id done to try and make it a bit easier but the link was removed

  • Can you post up a CAPX of how it's misbehaving and I can take a look.

  • Ive recreated the pathfinding that I have done on my full game in a seperate file, so that its easier for you to find (Rather than have you try to search through the event sheet to find it). The NPC does the same thing in this version as it does in my full game.

    dropbox.com/s/i1f260c009ojrgh/TestFile!.capx

    The URL is missing the this is just so I can get around it being removed

    Thanks again

  • I have got the NPC's moving around my game now. I did it a slightly different way to the way you showed me, but your way helped a great deal.

    Thanks again

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