错误cs0119表达式表示一个类型',其中预期变量'value'或方法组'

时间:2015-02-16 19:44:22

标签: c# unity3d

基本上我正在写一个脚本,我得到了这个错误。

error cs0119 expression denotes a type' where a variable' value' or method group' was expected

这是我的代码:

using UnityEngine;
using System.Collections;

public class BallControl : MonoBehaviour {

    void FixedUpdate () {

        float moveHorizontal = Input.GetAxis ("Horizontal");
        float moveVertical = Input.GetAxis ("Vertical");

        Vector3 movement = new Vector3 (moveHorizontal, 0.0f, moveVertical);

        rigidbody.AddForce (Vector3);
    }
}

我试图制作一个脚本,使用WASD或箭头键移动球体(球)。我正在关注在线教程。而且我确信我做的事情是正确的。

1 个答案:

答案 0 :(得分:3)

也许,您的意思是将movement应用到rigidbody

//rigidbody.AddForce (Vector3);
rigidbody.AddForce (movement);
相关问题