📅  最后修改于: 2022-03-11 14:49:12.802000             🧑  作者: Mango
Rigidbody rb;
float force = 10f;
void Awake(){
rb = GetComponent();
}
void Update(){
if(Input.GetKeyDown(KeyCode.Space)) {
rb.AddForce(Vector3.up * force, ForceMode.Impulse);
}
}