0 Favourites

Patrol and Attack

  • With the help of users on this forum, I've reached a pretty good point in the development. I can have many NPCs walking around and navigating the level pretty well.

    The problem comes when I want the NPCs to change what they are doing. Their standard action is to randomly walk around the level, however, I also have a system in place that has them shoot objects out in front of them, which get larger until they hit a wall, at which point they are destroyed. This is to replicate their field of vision, so certain parts are obstructed by walls, but NPCs will still be able to see the player from the 'corner of their eye' so to speak.

    When these field of vision objects hit the player, it spawns a remember point at the players location, which the NPC should walk toward, and hopefully be updated when the field of vision again hits the player. This will allow the played to hide from and escape the NPCs.

    In any case, I hope I explained that well. The problem is that I struggled to have the field of vision objects relate to the correct NPC, but I think I have that sussed. The issue comes when I want the NPC to follow the player. For some reason, once they have found the player, they just walk straight into a wall and get stuck. I cannot see what I have done wrong.

    I'd also like to know if there is a way to simplify what I have done.

    Link

  • Construct 3

    Buy Construct 3

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

    Buy Now Construct 3 users don't see these ads
  • Are you using pathfinding to reach the player or just saying move in direction of the player?

  • To reach the player <img src="smileys/smiley1.gif" border="0" align="middle" />

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)
Similar Topics Posts Views Last Post
Unread hot topic
49 6,119
sekocit's avatar
sekocit

You do not have permission to view this topic

Topic
0 Favourites
Patrol, Attack, Patrol...
14 2,189
manukeo's avatar
manukeo