발생한 문제 : 차량 회전을 해도 가해지는 힘이 Global기준 임
해결 방안 : 차량의 Local 좌표기준의 앞 방향으로 힘이 가해져야함
검색 키워드 : unity how to add force in local
검색 결과 :
https://discussions.unity.com/t/addforce-in-local-space/12023
=> Use AddRelativeForce instead of AddForce.
=> AddForce 대신에 AddRelativeForce를 사용하십시오.
AddRelativeForce에 대해 검색 :
https://docs.unity3d.com/ScriptReference/Rigidbody.AddRelativeForce.html
Unity - Scripting API: Rigidbody.AddRelativeForce
Force can be applied only to an active rigidbody. If a GameObject is inactive, AddRelativeForce has no effect. Wakes up the Rigidbody by default. If the force size is zero then the Rigidbody will not be woken up. For more information on how ForceMode affec
docs.unity3d.com
'Unity Learn > 주니어 프로그래머' 카테고리의 다른 글
6단원 - 조사 및 문제 해결 : WheelCollider (0) | 2024.11.28 |
---|---|
6단원 - 조사 및 문제 해결 : centerOfMess (0) | 2024.11.28 |
6단원 - 프로젝트 최적화 : 오브젝트 풀링 (0) | 2024.11.27 |
6단원 - 프로젝트 최적화 : LateUpdate() (0) | 2024.11.26 |
6단원 - 프로젝트 최적화 : FixedUpdate() (0) | 2024.11.26 |