RollABall 小游戏中小球在unity中速度可调快慢,但打包后速度一直很慢。即使player代码中把速度变量变成固定值设置大也没用,仍然很慢。请教下什么原因导致的?
变量方式:
void Update()
{
// rd.AddForce(Vector3.right);
//rd.AddForce(new Vector3(1, 0, 0));
float f = Input.GetAxis("Horizontal");
float h = Input.GetAxis("Vertical");
// Debug.Log(r);
rd.AddForce(new Vector3(f, 0, h)* speed);
scoreText.text = "Score:" + score;
}
speed直接改固定值:
void Update()
{
// rd.AddForce(Vector3.right);
//rd.AddForce(new Vector3(1, 0, 0));
float f = Input.GetAxis("Horizontal");
float h = Input.GetAxis("Vertical");
// Debug.Log(r);
rd.AddForce(new Vector3(f, 0, h)* 10);
scoreText.text = "Score:" + score;
}