Головна‎ > ‎Unity‎ > ‎

Дивитися на об'єкт

// 1
public Transform target;
transform.LookAt(target);


// 2
public Transform target;
transform.rotation = Quaternion.LookRotation(target.position - transform.position, Vector3.up);


// 3 - повільно
public Transform target;
Quaternion destRot = Quaternion.LookRotation(target.position - transform.position, Vector3.up);
transform.rotation = Quaternion.RotateTowards(transform.rotation, destRot, 10f * Time.deltaTime);