유니티 Rigidbody 노트
RigidBody를 이용한 회전 + Radian을 구하는 것이 핵심 private void FixedUpdate() { Angle = AngleCalculator.GetAngle(this.transform.forward.x, this.transform.forward.z); AngleDifference = (targetAngle.Angle - Angle); } public float GetAngle(floatx, floatz) { float value = (float)((Mathf.Atan2(x,z) / System.Math.PI) * 180f); return value; } Mathf.Atan2 return the angle in radian between x , y 지름을 arc로 변환시켰을 때의 곡선..
Unity/C# note
2021. 12. 7. 06:27