Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class PlayerMovement : MonoBehaviour
- {
- private CharacterController characterController;
- public float speed = 0.05f;
- void Start()
- {
- characterController = GetComponent<CharacterController>();
- }
- void Update()
- {
- Vector3 inputMovement = new Vector3(Input.GetAxis("Horizontal"), 0f, Input.GetAxis("Vertical"));
- characterController.Move(inputMovement * speed * Time.deltaTime);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement