using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class playerTest1 : MonoBehaviour
{
    [Header("移动速度")]
    public float movespeed = 5f;
    [Header("转身速度")]
    public float turnspeed = 5f;
    private float hor;
    private float ver;

    // Start is called before the first frame update
    void Start()
    {
        
    }

    // Update is called once per frame
    void Update()
    {
        hor = Input.GetAxis("Horizontal");
        ver = Input.GetAxis("Vertical");
        //前后移动
        transform.position += ver * transform.forward * Time.deltaTime * movespeed;
        //左右转身
        transform.eulerAngles += hor * Vector3.up * turnspeed;
    }

}