Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

Question The type or namespace name 'MultiAimConstraint' could not be found

Discussion in 'Animation Rigging' started by SamohtVII, Jan 29, 2023.

  1. SamohtVII

    SamohtVII

    Joined:
    Jun 30, 2014
    Posts:
    380
    I am struggling to find out why this code throws this error:

    The type or namespace name 'MultiAimConstraint' could not be found

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4. using UnityEditor.Animations.Rigging;
    5.  
    6. public class HeadLook : MonoBehaviour
    7. {
    8.  
    9.     private MultiAimConstraint mac;
    10.     void Start()
    11.     {
    12.         mac = GetComponent<MultiAimConstraint>();
    13.     }
    14.  
    15.     // Update is called once per frame
    16.     void Update()
    17.     {
    18.        
    19.         float inputVertical = Input.GetAxis("Vertical");
    20.         mac.weight = inputVertical;
    21.     }
    22. }
    23.  


    It's not complete code so ignore what it is trying to do. Just can't get rid of the error.
    Yes I have added Animation Rigging in the package manager.

    Thanks
     
  2. fabianoairon

    fabianoairon

    Joined:
    Jun 5, 2020
    Posts:
    3
    same here =(
     
  3. fabianoairon

    fabianoairon

    Joined:
    Jun 5, 2020
    Posts:
    3
    its crazy that this was working minutes ago... suddendly it stopped working.

    PS.: UnityEditor.Animations.Rigging must be UnityEngine.Animations.Rigging