using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class PlayerMovement : MonoBehaviour
{
private CharacterController controller;
public float speed = 12f;
Vector3 velocity;
private Vector3 lastPosition = new Vector3(0f,0f,0f);
void Start()
{
controller = GetComponent<CharacterController>();
}
// Update is called once per frame
void Update()
{
float x = Input.GetAxis("Horizontal");
float z = Input.GetAxis("Vertical");
Vector3 move = transform.right * z + transform.forward * -x;
controller.Move(move * speed * Time.deltaTime);
}
}