If you just want to make a slave object to follow the master movements and rotations with some delay, you can use something like this (slave script):
var master: Transform; // drag the master object here
var delay: float = 0.6;
private var offsetPos: Vector3;
private var startRot: Quaternion;
private var masterRot: Quaternion;
function Start(){ // save the initial positions/rotations
offsetPos = transform.position - master.position;
startRot = transform.rotation;
masterRot = master.rotation;
}
function LateUpdate(){
var targetPos = offsetPos + master.position;
var targetRot = Quaternion.Inverse(masterRot) * master.rotation * startRot;
var dT = Time.deltaTime / delay;
transform.position = Vector3.Lerp(transform.position, targetPos, dT);
transform.rotation = Quaternion.Lerp(transform.rotation, targetRot, dT);
}
The slave object follows the master object’s position and rotation smoothly, and the delay parameter adjusts how slowly it does it.
This is not an actual delay. If you really need a fixed delay between the master and the slave, things become more complicated: you must use a couple of arrays to store master position/rotation at regular intervals, and get the slave position/rotation from N elements behind the last element stored.