first person view unity
snippet in c

first person view unity

user6873

// C Sharp
public Transform followTarget;
public Vector3 targetOffset;
public float moveSpeed = 2f;
private Transform myTransform;

void Start(){
 myTransform = transform; 
}

public void SetTarget(Transfrom aTransform){
 followTarget = aTransform; 
}

void LateUpdate(){
 if(followTarget != null){
  	myTransform.position = Vector3.Lerp(myTransform.position, followTarget.position + targetOffset, moveSpeed * Time.deltaTime); 
 }
}