ย ย [SerializeField]
ย ย Rigidbody rb;
ย ย [SerializeField]
ย ย float obrote;
ย ย // Start is called before the first frame update
ย ย void Start()
ย ย {
ย ย ย ย ย
ย ย }
ย ย // Update is called once per frame
ย ย void FixedUpdate()
ย ย {
ย ย ย ย Quaternion rotate = Quaternion.Euler(new Vector3());
ย ย ย ย rotate *= Quaternion.Euler(new Vector3(0, 0, obrote) * Time.fixedDeltaTime);
ย ย ย ย rb.MoveRotation(rotate * transform.rotation);
ย ย }
๋ฌผ์ฒด ํ์ ์ํค๋ ์ฝ๋์ธ๋ฐย
rigidbody.MoveRotation ์ผ๋ก ํ์ ์ํค๊ณ ์ด๊ฑฐ ๋ง๊ณ ์๋ฌด๊ฒ๋ ์๋๋ฐ
iskinematic ์ฒดํฌ ์ํ๋ฉด ๊ฐ์ฒด ๋ณด๊ฐ ์๋๋๋ฐย
๋ ์ฐพ์๋ณด๋๊นย iskinematic ์ํ๋ฉด ๋ณด๊ฐ ์๋๋ค๋๋ฐ ๋ฐฉ๋ฒ ์๋๊ฑฐ์?
rigidbody.MoveRotation ๊ด๋ จย api ์๋ ๋๋ฌด ์๋ต๋์ด์๋๊ฑฐ ๊ฐ์์ ๋ญ ์ฝ์๊ฒ ์๋๋ผ
๋์ด ๋ฌด์จ ๊ฒฐ๊ณผ๊ฐ์ ์ํ๋๊ฑด์ง, ๋ญ๊ฐ ์๋๋๊ฑด์ง ์ ํ ๋ชจ๋ฃจ๊ฒ ์
interpolation์ ์ผ๋ ํ์ ํ ๋ ๋ณด๊ฐ์ด ์์ผ์ด๋จ?
ํด๋น ์คํฌ๋ฆฝํธ๋ ํน์ rigidbody ์ปดํฌ๋ํธ๋ฅผ ๊ฐ์ง ๊ฐ์ฒด๋ฅผ ํ์ ์ํค๋ ์คํฌ๋ฆฝํธ์ด๊ณ obrote ๊ฐ๋งํผ ํด๋น ๊ฐ์ฒด๋ฅผ rigidbody .MoveRotation๋ก ํ์ ์ํค๋ ๋ฐฉ์์ธ๋ฐ ์ง์ ํ ๊ฐ์ฒด์ ๋ณด๊ฐ ์ผ๋๊ณ ํ์ ์ํค๋ฉด ํด๋น ๊ฐ์ด ๋ณด๊ฐ์ด ์๋์ฒด๋ก ๋ฐ๋ก ๋ชฉํ ๊ฐ์ผ๋ก ์๊ฐ์ด๋ํ๋ฏ์ด ํ์ ํด๋ฒ๋ฆผ
์ธํฐ๋ท ์ฐพ์๋ณด๋๊น rigidbody.MoveRotation ์ฌ์ฉํ ๋ iskinematic ์ด๊ฑฐ ์์ผ๋๋ฉด ๋ณด๊ฐ์ด ์๋๋ค ํ๋๋ผ๊ณ ํน์ ์ด๊ฑฐ ์์ผ๋ ๋ณด๊ฐ ๋ฐ์ผ๋ฉด์ ํ์ ํ ์์๋์ง ๋ฌผ์ด๋ณด๋๊ฑฐ์์
์ํ ๊ทธ๋ ๊ตฌ๋ ๊ถ๊ธํด์ ์คํํด๋ดค๋๋ฐ ์ง์ง ์๋๋น
https://forum.unity.com/threads/rotating-a-rigidbody-fps-player-makes-objects-jitter.1065686/
์ฌ๊ธฐ
๋ง๋๋ก physicsupdate ๋๋๊ณ moverotation ํด์ฃผ๋ ๋๋ค
์ค ๋๋ค ๊ฐ์ฌ๊ฐ์ฌ ใ ใ ใ ใ ์ด๊ฒ ์ ๋๋๊ฑด์ง ์ดํด๊ฐ ์๋๋ค ๋ง๋งํ๋ค ใ ใ ใ ใ ใ
๋๊ธ์๋ ์ ๊ฐ์ถ๊ฐ ์๋๊ฑธ๊น