Skip to main content

Indie game storeFree gamesFun gamesHorror games
Game developmentAssetsComics
SalesBundles
Jobs
TagsGame Engines

using System.Collections;

using UnityEngine;

public class SimpleWalker : MonoBehaviour

{

    private CharacterController characterController;

    public float speed = 5f;

    void Start()

    {

        characterController = GetComponent<CharacterController>();

    }

    void Update()

    {

        float horizontal = Input.GetAxis("Horizontal");

        float vertical = Input.GetAxis("Vertical");

        Vector3 direction = new Vector3(horizontal, 0f, vertical).normalized;

        Vector3 move = direction * speed * Time.deltaTime;

        characterController.Move(move);

    }

}