One way would be to use timed Signals
Basically you add the time of the input + the delay to an Array
then consume those stored events in the process function
CopycatEnemy.gd
var movement = Array()
var delta_time = 0
func _ready():
$Player_node.connect("follow", self, "copy_input")
func copy_input (direction, time, speed)
var move = Dictionary()
move.direction = direction
move.time = time
move.speed = speed
movement.append(move)
func _physics_process(delta):
motion.y += 10
if not movement.empty():
delta_time += delta
var move = movement.front()
if delta_time >= move.time:
if move.direction in ["left", "right"]:
motion.x = move.speed
elif move.direction in ["up", "down"]:
motion.y = move.speed
movement.pop_front()
delta_time = 0
motion = move_and_slide(motion, UP)
Player.gd
Signal follow(direction, time, speed)
func _physics_process(delta):
if Input.is_action_pressed("ui_right"):
motion.x = 150
emit_signal("follow", "right", 2, 150)
Etc. . . . . . .