You just have to make the other characters do exactly the same things the player-character does, but with a delay. So you have to create a script which records the actions of the player and then allows to retrieve the player's position X steps ago.

The C# standard already has the ideal data-structure for that, the [`Queue`][1]. It allows you to create a first-in-first-out buffer of a fixed size where you can add elements to the end with Enqueue and remove elements from the beginning with Dequeue.

    using System.Collections.Generic;
    using UnityEngine;
    
    public class FollowTheLeader : MonoBehaviour {
        public GameObject leader; // the game object to follow - assign in inspector
        public int steps; // number of steps to stay behind - assign in inspector
    
        private Queue<Vector3> record = new Queue<Vector3>();
        private Vector3 lastRecord;
    
        void FixedUpdate() {
            // record position of leader
            if (lastRecord != leader.transform.position) {
                lastRecord = leader.transform.position;
                record.Enqueue(lastRecord);
            }
            // remove last position from the record and use it for our own
            if (record.Count > steps) {
                this.transform.position = record.Dequeue();
            }
        }
    }

This script is just a very simple proof-of-concept. It only copies the position, but you likely also want it to copy the player's rotation (or at least the direction it faces), what action it performs (walking, jumping, etc.) and also handle a couple other edge cases specific to your game. So you will likely need to record more in the queue than just a Vector3. If that is the case, create your own `struct` with all the data you need and use that as the type of your queue.

You might also want to be more sophisticated in your conditions regarding when to Dequeue the position and when to wait than just counting the number of steps. For example, if the player jumps, you might not want the follower to stop mid-air. You might want them to wait until the player completed the jump. So you might want to use `record.Peek()` to look at the next action in the queue without removing it and if you find that it is a "start to jump" action, then don't dequeue it while the leader is still in the air. And if the player hasn't cleared the landing location yet, you don't want the follower to stop mid-air either. So you might also have certain "uninterruptible" follower actions which cause the script to ignore the minimum steps distance to the leader.

  [1]: https://docs.microsoft.com/en-us/dotnet/api/system.collections.generic.queue-1?view=netframework-4.8