Search Unity

Problems with scripts

Discussion in 'Scripting' started by emile331, Jan 7, 2020.

  1. emile331

    emile331

    Joined:
    Jan 7, 2020
    Posts:
    1
    Hi I have a problems with my script! When I try to start the game I check on the console and it says :
    Assets/PlayerMotor.cs(7,9): error CS0246: The type or namespace name `RigidBody' could not be found. Are you missing an assembly reference?. I send you this maybe with a screenshot.
     

    Attached Files:

  2. WallaceT_MFM

    WallaceT_MFM

    Joined:
    Sep 25, 2017
    Posts:
    394
    There are a few things you can try:
    1. Reimport the script
    a. Find the script in the project view/window
    b. Right click, selected Reimport

    2. Restart Unity

    3. Rebuild the Library folder
    a. Close Unity
    b. Go to your FPS Game folder (the one that contains the Assets folder)
    c. Delete the Library folder. This is safe to do and will not make you lose any of your work.
    d. Start Unity. It will take longer to start than normal as it rebuilds the Library folder.
     
  3. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    8,775
    It's "Rigidbody", not "RigidBody". The capitalization is important.
     
    Joe-Censored likes this.