Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

Resolved i am a little bit dumb

Discussion in 'Getting Started' started by razumovlev85611, Sep 1, 2021.

  1. razumovlev85611

    razumovlev85611

    Joined:
    Sep 1, 2021
    Posts:
    1
    I just downloaded unity yesterday and started watching the guide from Brackeys I did everything exactly with the guide but something went wrong when I started manipulating the Rigitbody component
    Code (CSharp):
    1.  
    2. using UnityEngine;
    3.  
    4.  
    5. public class move : MonoBehaviour {
    6.  
    7. public Rigidbody rb;
    8.  
    9. // Start is called before the first frame update
    10. void Start()
    11. {
    12.  
    13. }
    14.  
    15. // Update is called once per frame
    16. void Update()
    17. {
    18.  
    19. }
    20. }
    in these three lines of code, two of which were written by the unity engine itself, the error Assets\PlayerMovement.cs(6,12): error CS0246: The type or namespace name 'Rigitbody' could not be found (are you missing a using directive or an assembly reference?)
    here is a screenshot from which I copied. What am I doing wrong?
     

    Attached Files:

  2. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,959
    "Rigitbody", this has a typo.
     
  3. Schneider21

    Schneider21

    Joined:
    Feb 6, 2014
    Posts:
    3,512
    To elaborate a bit on Acid's answer: the error isn't in the script you shared. It's on line 6 of PlayerMovement.cs, as the error message is telling you.
     
  4. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    21,462
    Did you read the error prior to posting this thread and then try to look at the line it specified? If you can't figure out where the line is it's the first number right after the script name in parenthesis. You can ignore the error code. The text is saying you gave a name and it can't find it. Clearly the name is wrong.

    Another way of finding the error is to simply double click the error in the console. Unity will open Visual Studio (or another IDE you've selected) and move the cursor to the line the error occurs on.

    Within Visual Studio the error will be pointed out by a red squiggly line under the name. If you hover the mouse over the squiggly line it will provide more details.
     
    Last edited: Sep 2, 2021
    Joe-Censored and Schneider21 like this.