从本质上讲,我想要的是我的玩家不仅要转弯,而且还要转弯速度。
它已经加快了正确的速度。我只是想让它而不是漂移,而是转弯,而不是旋转。
using System.Collections.Generic;
using UnityEngine;
using System;
public class PlayerController : MonoBehaviour {
public GameObject player;
public Vector3 Vector;
public float TurnSpeed=0;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
Vector3 Movement = new Vector3(0,Input.Getaxis("Vertical"));
{
TurnSpeed += -(float)Input.Getaxis("Horizontal");
//player.transform.position += new Vector3(0,Input.Getaxis("Vertical")*.3f,0);
player.transform.Rotate(0,(float)TurnSpeed*2);
Vector= new Vector3(0f,Input.Getaxis("Vertical"),0f);
player.getcomponent<Rigidbody2D>().AddRelativeForce(Vector*12);
TurnSpeed = TurnSpeed*.5f;
}
}
}