2-1) Creating Car Controller Script and Moving The Cat

시그니천·2024년 6월 3일

[ G01 ] ZigZagRacer

목록 보기
6/26

  1. Create Scripts Folder
  2. CatController.cs 추가
  3. Attach Script with Object
  4. Script 작성
public class CharacterController : MonoBehaviour
{
    [SerializeField] private float moveSpeed;

    private void Update()
    {
        Move();
    }

    private void Move()
    {
        transform.position += transform.forward * moveSpeed * Time.deltaTime;
    }
}
profile
우주최강개발자

0개의 댓글