Unity3d LookAt參數說明
//
// 摘要:
// Rotates the transform so the forward vector points at target's current position.
//
// 參數:
// target:
// Object to point towards.
//
// worldUp:
// Vector specifying the upward direction.
public void LookAt(Transform target, Vector3 worldUp);
其中 target爲朝向的目標,worldUp爲對象朝向目標後旋轉自身,使得worldUp垂直z軸向上;
transform.LookAt(target,transform.right);
transform.LookAt(target,-transform.right);
transform.LookAt(target,transform.up);
transform.LookAt(target,-transform.up);