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

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:
    368
    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