0

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.

1 Answer 1

3

Maybe, you mean to apply movement onto the rigidbody?

//rigidbody.AddForce (Vector3);
rigidbody.AddForce (movement);
Sign up to request clarification or add additional context in comments.

1 Comment

I did that and it stopped giving errors, But the script doesnt seem to work with a warning saying the referenced script on this behavior is missing

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.