공중 유닛 x축 회전 제한

작업자
강성원
Issue.No
10
날짜
2024/03/21
분류
버그
심각도
10
완료
착수
protected override void Look() { // 타겟 방향 계산 Vector3 targetDirection = (boss.Target.transform.position - boss.transform.position).normalized; Quaternion lookRotation = Quaternion.LookRotation(targetDirection); lookRotation.x = Mathf.Min(lookRotation.x, 25f);
boss.transform.rotation = Quaternion.RotateTowards(boss.transform.rotation, lookRotation, 60 * Time.deltaTime);
Plain Text
복사
}
protected override void Look() { // 타겟 방향 계산 Vector3 targetDirection = (boss.Target.transform.position - boss.transform.position).normalized; Quaternion lookRotation = Quaternion.LookRotation(targetDirection); lookRotation.x = Mathf.Min(lookRotation.x, 25f); boss.transform.rotation = Quaternion.RotateTowards(boss.transform.rotation, lookRotation, 60 * Time.deltaTime); }
C#
복사
lookRotation의 x를 제한해주면 될 줄 알았는데, 일단 이렇게 하면 말 안들음.