AController::ControlRotation ์์์,
์ด๊ฑธ ์บ๋ฆญํฐ ํด๋์ค์์ย MoveForward๋ MoveRight ๋ด์ย Controller->GetControlRotation()์ผ๋ก ๋ฐ์์ย
์ด๋๋ฐฉํฅ์ย ๋ง๋๋๋ฐ ์ฐ๋๋ฐ,
ControlRotation๊ฐ ๋ญ์ ๋กํ ์ด์ ์ ๋ํ๋ด๋๊ฑด์ง ์ดํด๊ฐ ์ ์๋จ. ์ปจํธ๋กค๋ฌ๊ฐ ๋ฉ์ฌ๊ฐ ๋ฌ๋ ค์๋๊ฒ๋ ์๋์์.
GetControlRotation() ๋ฌธ์ ์ฝ์ด๋ณด๋ฉด
Get the control rotation. This is the full aim rotation, which may be different than a camera orientationย
(for example in a third person view), and may differ from the rotation of the controlled Pawnย
(which may choose not to visually pitch or roll, for example).
๋ผ๊ณ ์จ์๋๋ผ๊ณ . ๊ทผ๋ฐ ์์์ ๋งํ๋ full aim rotation์ด๋ผ๋๊ฒ ๋ญ์ง๋ ๋ชจ๋ฅด๊ฒ ๊ณ ,ย ์ด๊ฒย ์นด๋ฉ๋ผ ์ค๋ฆฌ์ํ
์ด์
ํ๊ณ ๋ ๋ค๋ฅผ์ ์๊ณ
ํฐ์ ๋กํ ์ด์ ํ๊ณ ๋ ๋ค๋ฅผ์ ์๋ค๋๋ฐ ๊ทธ๋ฌ๋ฉด ์ ํํ ๋ญ๋ผ๋ ๊ฑฐ์?
๊ทธ๋์ ControlRotation์ ์ด๋ป๊ฒ ์ ๋ฐ์ดํธํ๋์ง ๋ณด๋ฉด ์์ ์์๊ฑฐ ๊ฐ์์ย
์ด๋์ ์ ๋ฐ์ดํธํ๋์ง ์ฐพ์๋ดค๋๋ฐ, ๋ณด๋ฉดย ํฐ์ Possess ํ ๋
SetControlRotation(Pawn->GetActorRotation()) ์ผ๋ก ์ ํ๋๊ฑด ๋์ค๋๋ฐ ๊ทธ๋ค์์
์ด๋ป๊ฒ ๊ณ์ ์ ๋ฐ์ดํธํ๋์ง๋ Controller.cpp ํ์ผ์ ๋ ์๋์ค๋๊ฒ ๊ฐ๋๋ฐ ๋ค๋ฅธ ํด๋์ค์์ ์ ๋ฐ์ดํธ ํด์ฃผ๋๊ฑด๊ฐ? ํ ...
ํด๋น ๋๊ธ์ ์ญ์ ๋์์ต๋๋ค.
์กํฐ ๋กํ ์ด์ ์ RootComponent์ Rotation ์ด๋ ๊ฐ์๊ฑฐ ์๋์ผ? GetActorRotation ์ ์ ๋ณด๋ฉด RootComponent->GetComponentRotation() ๋ฆฌํดํ๋๊ฑฐ๊ฐ์๋ฐ
๋ญ๋๊น ์ผ์ข ์ ์ฝ์ ๊ฐ์ ๊ฑฐ์ง. ์๋ฅผ ๋ค์ด ์บ๋ฆญํฐ๊ฐ ๋ฌ๋ฆฌ๋ ์ ๋๊ฐ ์๋ค๋ฉด ์๋๊ฐ์ ๊ธฐ์ค์ผ๋ก ์์ ์๊ฐ ์์ ์ ํ๊ณ ๋ค๋ฅธ ์ฌ๋์ ์๋๊ฐ์ด ๊ธฐ์ค์ผ๋ก ์ด๋์ํค๊ณ ์ด๋์ ์ํ๋ ์ฌ๋์ ์๋๋ง ๋ณ๊ฒฝํ๋ฉด ์์์ ์ ์๋ํ๊ฒ. ์ปจํธ๋กค ๋กํ ์ด์ ๋ ํ๋ ์ด์ด ์กฐ์ ์ ํ์ ์ ๊ธฐ์ค์ผ๋ก ์ฝ์ํ๊ณ ๊ฐ์ ์์ ํ๋ ๊ฑฐ์ง ๋ฐ๋ผ๊ณ ๋๊ณ ์๋ฐ๋ผ๋ ๋จ. ๊ฐ๋ น ์นด๋ฉ๋ผ ๋ฐฉํฅ์ด ์กฐ์ ๋ฐฉํฅ๊ณผ ์ผ์นํ์ผ๋ฉด ์ข๊ฒ ๋ค๊ณ ์๊ฐํ๋ฉด ์ปจํธ๋กค์ ํ์ ๊ณผ ์ผ์น์ํค๋ ์. ์กฐ์ ๋ฐฉํฅ์ ์บ๋ฆญํฐ๊ฐ ๋ฐ๋ผ๋ณด๊ณ ์ถ๋ค๋ฉด ์ปจํธ๋กค ๋กํ ์ด์ ์ ์ฐธ์กฐํด์ ํ์ ๋ฑ๋ฑ