攝像機用rotateAround圍繞角色旋轉,
但是當角色移動的時候,攝像機就不能圍繞角色旋轉了。
下面是代碼
x = Input.GetAxis ("Mouse X") * rotateSpeed;
y = Input.GetAxis ("Mouse Y") * rotateSpeed;
transform.RotateAround (target.position,Vector3.up,x);
transform.RotateAround (target.position,transform.right,-y);
Vector3 newPos = target.position + Vector3.up * 1.3f - target.forward * 1.7f;
transform.position = Vector3.Lerp (transform.position,newPos,Time.deltaTime*2f);
轉載請註明出處,本文鏈接:https://www.uj5u.com/qita/37510.html
標籤:Unity3D
