• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
This question was closed Aug 14, 2014 at 07:40 AM by Kiwasi for the following reason:

Duplicate Question

avatar image
Question by iChealseaSmileU · Aug 14, 2014 at 05:39 AM · errorbeginnercompilerroll a ball

Roll A Ball- "All compiler errors have to be fixed before you can enter playmode!"

I'm trying to do the Roll A Ball tutorial but I'm stuck at moving your player. I have programmed before and I am positive there is nothing wrong with my code. I will post it below. It's just the basic first code that the tutorial has you set up to move the ball right after it has you set the speed (note: It didn't work before I added the code for the speed but I wanted to jump start and add it anyway). Any help would be so appreciated! I want to finish this and keep learning!!!

 using UnityEngine;
 using System.Collections;
 
 public class PlayerController : MonoBehaviour 
 {
     public float speed;
 
     void FixedUpdate ()
     {
         float moveHorizontal = Input.GetAxis("Horizontal");
         float moveVertical = Input.GetAxis("Vertical");
         
         Vector3 movement = new Vector3(moveHorizontal, 0.0f, moveVertical);
         
         Rigidbody.AddForce(movement * speed * Time.deltaTime);
     }
 }

Thanks!!

Comment

People who like this

0 Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image iChealseaSmileU · Aug 14, 2014 at 10:54 PM 0
Share

Update: I sent the program file to my buddy who has Unity and he said it is working fine for him. I still can't get it to work. I'm going to reinstall Unity and try that. But if that doesn't work I have no idea what the deal is.

avatar image meat5000 ♦ · Aug 14, 2014 at 11:02 PM 0
Share

Tried running in Admin mode?

Got Mono installed? (And whatever VS runtime is req)?

Got .net stuff installed?

1 Reply

  • Sort: 
avatar image

Answer by robertbu · Aug 14, 2014 at 05:42 AM

I am positive there is nothing wrong with my code

If I had a dime for every time someone made this claim on this list when there was issues with the code.... ;)

One problem that jumps out at me is on line 8, 'Rigidbody' with an upper case 'R' should be 'rigidbody' with a lower case 'r'. 'Rigidbody' is the class. 'rigidbody' is a Unity provided short-cut variable that gets the rigidbody component on the game object. You will see this kind of thing in Unity: Transform vs transform, Collider vs collider, Renderer vs renderer... And the auto correction of Monodevelop makes this issue worse since it often changes things like transform to Transform to "help" you.

Comment
Kiwasi

People who like this

1 Show 9 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image iChealseaSmileU · Aug 14, 2014 at 03:37 PM 0
Share

Thank you so much!! I searched so many threads on this site but couldn't find this one specifically. I only learned to program on Java and I've never done C# ever. This is my foray into deciding if I want to make video games for a living. So. I want to teach myself as much as possible so I can make an educated decision. Once I see this ball actually move I will probably freak out. Haha. Thanks again. For some reason the compiler wouldn't tell me where my error was. Is there a way to get it to point out the line that there is an error on? I've tried what everyone says about clicking on the red error message but that doesn't work.

avatar image robertbu · Aug 14, 2014 at 05:27 PM 0
Share

It's double click on the error message to highlight in Monodevelop. On my Windows mancine, I have to switch to Monodevelop by hand. Also on Windows, if Monodevelop is not running, the first time I double click, the wrong file is sometimes displayed. A second double click works. On the Mack, the Monodevelop is brought to the foreground and the correct line is displayed first time. Note the error itself includes the line number and usually and offset as well. Just before the error you will see something like (33,12) which means the error is on line 33 and the 12 character on that line. But this is just the point where the compiler got confused enough to throw the error. Often the error is in the line before or sometimes many lines before.

avatar image meat5000 ♦ · Aug 14, 2014 at 05:48 PM 0
Share

Check out my answer on this QA @iChealseaSmileU for extra info in the case that Console shows nothing.

avatar image iChealseaSmileU · Aug 14, 2014 at 06:57 PM 0
Share

I still cannot figure this out. I changed the uppercase R to a lowercase r on rigidbody. Everything else I kept the same. And I can't find anything anywhere that says what line the error is on. This is so frustrating. I don't want to give up but I need help. If it's an issue with Unity that's different, but I just have no clue why it isn't working. This stupid ball is never going to move.

avatar image meat5000 ♦ · Aug 14, 2014 at 07:02 PM 0
Share

And I can't find anything anywhere that says what line the error is on.

Did you read the QA?

Show more comments

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Internal Compiler Error 1 Answer

How do I display text in current Unity in the first roll-a-ball project? 1 Answer

error issues : KeyNotFoundException 1 Answer

'else' not working.... please help:( 4 Answers

Strange problem with unity compiler. 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges