慕尼黑8549860
设定一个速度值speed,按键时,减少speed的值,这是最简单的做法了。public float Speed = 1.0f;public float AddSpeed = 0.1f;void Start (){}void Update (){if (Input.GetKey(KeyCode.W))Speed += AddSpeed;if (Input.GetKey(KeyCode.S))Speed -= AddSpeed;Speed = Mathf.Clamp(Speed,0,Speed);transform.Translate(Vector3.forward*Time.deltaTime*Speed);}