SCS
SCS

Reputation: 121

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

Basically im writing a script and i get this error.

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

Here is my code:

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);
    }
}

Im trying to make a script that will make a sphere (ball) move using WASD or arrow keys. I am following an online tutorial. And i am sure i did evrything correct.

Upvotes: 0

Views: 912

Answers (1)

Xiaoy312
Xiaoy312

Reputation: 14487

Maybe, you mean to apply movement onto the rigidbody?

//rigidbody.AddForce (Vector3);
rigidbody.AddForce (movement);

Upvotes: 3

Related Questions