How do I create a follower/pet AI?

0 favourites
  • 2 posts
From the Asset Store
Players follower. use it for anything which follows the player
  • Hi there, I'm fairly new to Construct 3 but I've been pretty happy with what I've been managing to accomplish in a short span of time.

    For my next goal I want to do the following:

    I have three objects that are relevant here, say, player, pet and enemy.

    If there are enemies whithin a certain distance from the player: I need the pet to move in the direction of and "attack" the closest enemy to the player and check if other enemies meet this criteria. (I'm concerned with the possibility of the pet checking constantly for enemies and not finishing them off before moving to the next target)

    If the player leaves a certain threshold distance from the pet, I need it move back into that threshold if the above criteria is not met.

    And,finally, I want the pet to move around whithin that above mentioned threshold, stopping every few seconds to play an iddle animation if the two situations above are not met.

    So, a pretty basic pet AI.

    In the ideal world I would have toggles for the range of the thresholds mentioned above and/or toggles to enable/disable any of the above behaviors. (For the sake of future proofing since pets are going to be the main mechanic of the projects I plan on working on).

    How's the best way to go about these? I know this is a chunky one but any insight and input is dearly appreciated.

    Thanks in advance.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • What have you tried so far? And what type of game is it and what is the perspective of the game? Did you manage to get a pet following the player?

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