1
void Update() {
float xP = Input.GetAxis ("Horizontal")*Time.deltaTime * 20;
transform.Translate (Vector3(xP,0,0));//error is here
transform.position.x = Mathf.Clamp (transform.position.x, -10, 10);
}
错误:表达式表示type', where a
变量 'value' or
方法组' 被expected`表达式表示`类型 '其中一个`变量',`值 '或'方法组' 预计UNITY3D
那么你能指望什么'的Vector3(XP,0,0)'做什么?我*怀疑*你想'new Vector3(xP,0,0)',但我们不能说。 – 2014-09-29 17:05:23
这几乎可以肯定它 – theodox 2014-09-29 17:08:54
添加“新”关键字不起作用 – Hgp7 2014-09-29 17:10:02