Search Unity

Bug Can't access Rig Builder Component from script

Discussion in 'Animation Rigging' started by Only4gamers, Dec 1, 2020.

  1. Only4gamers

    Only4gamers

    Joined:
    Nov 8, 2019
    Posts:
    327
    Hello everyone,
    I am trying to disable Rig Builder Component from script but it's showing this error:
    Code (CSharp):
    1. The type or namespace name 'RigBuilder' could not be found (are you missing a using directive or an assembly reference?)
    this is my code:
    Code (CSharp):
    1. GetComponent<RigBuilder>().enabled = false;
     
  2. danUnity

    danUnity

    Joined:
    Apr 28, 2015
    Posts:
    229
    Visual Studio is telling you that you are missing the namespace.

    When you see that error you can click on the word in Visual Studio, in this case "RigBuilder" and hit <CTRL + .>
    (CTRL plus dot on your keyboard) and it will come up with suggestions on how to fix it.

    In your case you need to add the namespace at the beginning of your script at the top.

    using UnityEngine.Animations.Rigging;
     
  3. Only4gamers

    Only4gamers

    Joined:
    Nov 8, 2019
    Posts:
    327
    Thank you so much :). You solved my two problems. I am searching for this shortcut from few days.
     
    danUnity likes this.