trasform.up

🧭 Unity의 좌표축

Unity에서 모든 오브젝트는 **자신만의 로컬 좌표계(Local Axis)**를 가져.


🎯 예를 들어볼게

image.png


📌 왜 중요해?

transform.up은 보통 이런 데 쓰여:

용도 설명
오브젝트의 이동 방향 transform.up * speed → 위쪽 방향으로 이동
총알 발사 방향 Instantiate(bullet, pos, rot).velocity = transform.up * speed;
드리프트/회전 확인 Vector2.Dot(velocity, transform.up) 같은 계산

Rigidbody2D

기능 설명 언제 사용해?
rb.linearVelocity 현재 속도(방향 + 크기) 오브젝트가 얼마나 어떻게 움직이는지 알고 싶을 때
rb.linearVelocity.magnitude 현재 속도의 크기 (속력) 속도 제한, 드리프트 체크 등
rb.MoveRotation() 물리 기반 회전 자동차 회전, 회전 제어할 때 유용
rb.AddForce() 물리 엔진을 통해 힘 가하기 점프, 미끄러짐, 부드러운 밀기 등

🧲 rb.velocity (또는 rb.linearVelocity)

📌 설명: