유니티 플레이어 3D 캐릭터 움직임, 이동 시키기
유니티에서 간단하게 아래와 같은 C# 스크립트를 만들고 움직이길 원하는 캐릭터에 컴포넌트를 추가해 준 다음 Inspector 창에서 speed의 값을 넣은다음에 플레이 후 움직임을 확인한다. 애니메이션을 안넣었기 때문에 모션 그대로 움직이는 것을 확인할 수 있다. using System.Collections; using System.Collections.Generic; using UnityEngine; public class Player : MonoBehaviour { public float speed; float hAxis; float vAxis; Vector3 moveVec; void Start() { } void Update() { hAxis = Input.GetAxisRaw("Horizontal"..
유니티
2023. 7. 5. 03:10