好,所以我在一分钟前在我的代码中犯了一些错误,但现在却没有继承人的代码,它应该是一个脚本,可以使多维数据集移动,这真的很烂,请帮助我
public class Scriptyscript : MonoBehaviour{
public Rigidbody rb;
public float forwardForce = 10f;
public float cooldowntime = 20;
private float nextFireTime = 0;
void Start ()
void FixedUpdate ()
rb.AddForce (0, 0, forwardForce * Time.deltaTime);
if ( Input.GetKey("d") )
{
rb.AddForce(20, 0, 0 * Time.deltaTime );
}
if ( Input.GetKey("a") )
{
rb.AddForce(-20, 0, 0 * Time.deltaTime );
}
if (Time.time > nextFireTime)
if ( Input.GetKey("space") )
{
rb.AddForce(0, 300, 0 * Time.deltaTime );
nextFireTime = Time.time + cooldowntime;
}
}
}```
start和fixedUpdate方法没有大括号{}..也在第二条if语句中]