Team members always delay following the leader, and only follow after the leader has moved a certain distance. If it is possible to achieve the leader's movement, the team members will immediately follow ?
  • This is handled by the Follow Range of the move AI's Group Settings, e.g. the threshold can cause a delay, as well as the combatant's movement component (e.g. acceleration of a NavMesh agent).

    You can also use formations to have control over how they follow the leader (i.e. specific positions around it).
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Thank you for your reply.
    After multiple tests, following the leader is still not very satisfactory.
    I want to know if it's possible to use a schematic to make the characters follow the leader like "greedy snake"
  • Yes, that's possible and there are different ways to handle it.
    E.g. using a Tick Machine on your combatants to update their position each frame (using Move node). You'll need to handle calculating new positions based on the player position in the schematic using Vector3 variables.
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Sorry, I tried for almost a day but was unsuccessful.
    Can you provide an example for me to improve the schematic.
    Thank you.
  • edited December 9
    A very simple setup is to just use a Change Position node (in a tick machine's schematic) without waiting for it to finish movement. It's a bit less performant than calculating positions and using a Move node each frame, but it does the trick :)

    The schematic just uses a Change Position node:
    - moving object: Machine Object
    - to object: enable
    - object (target position): Player (or whatever you want to follow)
    - local space: enable
    - ignore scale: enable
    - offset: set the position in relation to the target to move to, e.g. X=0, Y=0, Z=-3 to follow 3 world units behind
    - move: enable
    - wait: disable, this'll basically restart this each frame
    - face direction: enable (most likely)
    - move by speed: enable
    - speed type: e.g. Run
    - follow position: disable (that'd ignore the offset)

    Set up a Tick Machine on your combatant prefab, e.g. running on Update or Late Update.
    Maybe add a condition to the machine to only run when being in control (game states). Additionally, you can also check in the schematic if the machine object is the player in case you add it to all combatants and don't have a fixed controlled player.
    Post edited by gamingislove on
    Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found.
    If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
  • Thank you, it has achieved follow.

    There is a new question : which node should I use in the schematic to check the order of members in the team? So i can assign different follow position to member in different order.(I searched for 'check', but couldn't find the correct node)
Sign In or Register to comment.