Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

character controllers mouselook.cs error PLEASE HELP!!!

Discussion in 'Scripting' started by InYourEyes, Feb 9, 2016.

  1. InYourEyes

    InYourEyes

    Joined:
    Feb 9, 2016
    Posts:
    3
    Hi guys i have a problem with mouselook.cs and this is my error


    Assets/Standard Assets/Character Controllers/Sources/Scripts/MouseLook.cs(61,35): error CS1061: Type `UnityEngine.Component' does not contain a definition for `freezeRotation' and no extension method `freezeRotation' of type `UnityEngine.Component' could be found (are you missing a using directive or an assembly reference?)

    How Can I Fix It

    i need the make a survival game but i have this error please help guyss :(:(:(:(:(:(

    and this is my codes
     

    Attached Files:

    Last edited: Feb 9, 2016
  2. LeftyRighty

    LeftyRighty

    Joined:
    Nov 2, 2012
    Posts:
    5,148
  3. InYourEyes

    InYourEyes

    Joined:
    Feb 9, 2016
    Posts:
    3
    i tried but and i have another error :/

    Assets/Standard Assets/Character Controllers/Sources/Scripts/MouseLook.cs(61,21): error CS0619: `UnityEngine.Component.rigidbody' is obsolete: `Property rigidbody has been deprecated. Use GetComponent<Rigidbody>() instead. (UnityUpgradable)'

    AND
    Assets/Standard Assets/Character Controllers/Sources/Scripts/MouseLook.cs(64,2): error CS8025: Parsing error
     
    Last edited: Feb 10, 2016
  4. Maxpak_studios

    Maxpak_studios

    Joined:
    Mar 12, 2018
    Posts:
    1
    I know this is too late but maybe my answer will help someone else.

    Change Your Code
    Rigidbody rigidbody;

    void Start(){
    rigidbody = GetComponent<Rigidbody> ();
    // Make the rigid body not change rotation
    if (rigidbody)
    rigidbody.freezeRotation = false;

    }
    }