- Home /
Duplicate Question
Roll-A-Ball tutorial error when attaching movement script to ball
I am new to Unity (and a beginner C# programmer), and am going through the Roll-A-Ball tutorial. I am at the point where I am attaching a script that handles the movement input for the ball. After completing the code and trying to playtest, I get this error:
"Assets/_Scenes/Scripts/PlayerController.cs(14,27): error CS0120: An object reference is required to access non-static member `UnityEngine.Rigidbody.AddForce(UnityEngine.Vector3, UnityEngine.ForceMode)'".
I triple checked and I typed everything correctly, so I am at a loss as to what to do. Any help would be appreciated, thank you.
Read through the questions tagged with cs0120. If you still need help open a new question, and explain what you've tried.
Follow this Question
Related Questions
What is the best way to move the player with physics without using MovePosition? 0 Answers
Rotate object towards target without influencing AddForce 0 Answers
Circular movement of gameobject with rigidbody 1 Answer
Rigidbody falling very slow 1 Answer
[Solved]Why doesn't this Rigidbody.AddForce work the way I tell it to? 1 Answer