Section 5.42: Unable to get handle of the Player's animator component?

  • Hello again everyone. Once again I am running into an issue with this lecture so let's just jump right to the point.


    I created the PlayerAnimation script following along with the video but I am unable to create the handle to the Animator component in the script. intellisense is not detecting it even though I have the PlayerAnimation script attached to the Player parent object within Unity. Please see the following for a visual of the script, and then a photo of in Unity:






    If I attempt to create a private handle to the Animator component in the player script, it works without an issue. What am I missing here? Thanks in advanced.


    EDIT: To cover all bases, I have already restarted my computer, Unity, and Visual Studios just in case there was a linking issue happening somewhere along the lines. Thank you!

  • I assume its in Visual Studio, by the name of your project "Miscellaneous Files". Install VS installer here, and do the following:


    - Close both VS and Unity

    - Launch VS 2017 Installer

    - Click Modify

    - Go to the "Individual components" tab

    - In the "Code Tools" section, check "Nuget Package Manager"

    - Click Modify



    Now, reload your project in VS/Unity, it should be good to go.

    Build+intellisense issues will be solved.

    As seen here, but if you have this package installed, follow this!

    Hope it helps!


  • Gobol, you are a genius. When I launched the VS installer, I updated the software and the Nuget Packet Manager was already selected. After restarting Unity and opening my files, the issue was resolved.


    This is pretty great though because I think you solved another issue I was experiencing periodically. Sometimes whenever I created new C# scripts, I got an error with them linking to my projects correctly. In Unity, I was having to go to Edit -> Preferences -> External Tools -> Script Editor and change it to Notepad, relaunch Unity, and then go back in and change it back to Visual Studios. Hopefully moving forward this won't be an issue. Cheers mate!