关于第一人称视角移动以及人物移动
设置空物体>>摄像机为空物体子物体>>为空物体添加角色控制器(主要是为了跳跃是检测地面)
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class NewBehaviourScript : MonoBehaviour
{
// Start is called before the first frame update
public float movespeed;
CharacterController playerController;
private Camera _camera;
Vector3 direction;
public float speed = 1;
public float jumpPower = 5;
public float gravity = 7f;
public float mousespeed = 2f;
public float minmouseY = -45f;
public float maxmouseY = 45f;
float RotationY = 0f;
float RotationX = 0f;
public Transform agretctCamera;
void