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

Bug Animation Rigging Weapon Attachment

Discussion in 'Animation Rigging' started by wagenheimer, Jun 25, 2020.

  1. wagenheimer

    wagenheimer

    Joined:
    Jun 1, 2018
    Posts:
    322
    I could not understand why I cannot add a Weapon to my Character!

    When I add a new model (A Basebal Bat) on the hand of my model, all animations stops working with the error :

    Code (csharp):
    1.  
    2. Transform 'BaseballBatAttachment' not found in HumanDescription.
    3. InvalidOperationException: The TransformStreamHandle cannot be resolved.
    4. UnityEngine.Animations.TransformStreamHandle.CheckIsValidAndResolve (UnityEngine.Animations.AnimationStream& stream) (at <a5ca0264dc584b65a7e26b617cf0c585>:0)
    5. UnityEngine.Animations.TransformStreamHandle.SetLocalTRS (UnityEngine.Animations.AnimationStream stream, UnityEngine.Vector3 position, UnityEngine.Quaternion rotation, UnityEngine.Vector3 scale, System.Boolean useMask) (at <a5ca0264dc584b65a7e26b617cf0c585>:0)
    6. UnityEngine.Animations.Rigging.RigSyncSceneToStreamJob+TransformSyncer.Sync (UnityEngine.Animations.AnimationStream& stream) (at Library/PackageCache/com.unity.animation.rigging@0.3.3-preview/Runtime/AnimationJobs/RigSyncSceneToStreamJob.cs:49)
    7. UnityEngine.Animations.Rigging.RigSyncSceneToStreamJob.ProcessAnimation (UnityEngine.Animations.AnimationStream stream) (at Library/PackageCache/com.unity.animation.rigging@0.3.3-preview/Runtime/AnimationJobs/RigSyncSceneToStreamJob.cs:117)
    8. UnityEngine.Animations.ProcessAnimationJobStruct`1[T].Execute (T& data, System.IntPtr animationStreamPtr, System.IntPtr methodIndex, Unity.Jobs.LowLevel.Unsafe.JobRanges& ranges, System.Int32 jobIndex) (at <a5ca0264dc584b65a7e26b617cf0c585>:0)
    9.  
    I'm using Animation Rigging only to make my character look at the direction of the enemies.
     
  2. nocanwin

    nocanwin

    Joined:
    May 7, 2009
    Posts:
    176
    I'm getting the same bug. I'm parenting an object to my characters hand at runtime. Everything works fine in the editor, but the build crashes.
     
  3. simonbz

    simonbz

    Unity Technologies

    Joined:
    Sep 28, 2015
    Posts:
    295
    Hi,

    Getting `InvalidOperationException: The TransformStreamHandle cannot be resolved.` means that the transform has not been added to the bindings in the Animator.

    To be as efficient as possible, all Transforms in Animation Rigging are animatable bindings in the Animator. This allows constraints to evaluate in the animation stream and read back directly from the animation output in threads. However, this also implies that changing the hierarchy at runtime will not update the animatable bindings directly.

    To do that, you'd need to do the following.

    Disable the animator.
    Rebuild the Animation Rigging Playable Graph by calling `RigBuilder.Build()`.
    Reenable the animator.

    However, rebuilding the PlayableGraph and rebinding the Animator is costly, so I would advise against doing it too often.
     
    CheapMeow likes this.
  4. CheapMeow

    CheapMeow

    Joined:
    Mar 30, 2021
    Posts:
    4
    Sorry for old reply, But your reply is the only related reply about this problem in Google

    I code as you say

    Code (CSharp):
    1.        
    2.         private void Start()
    3.         {
    4.             RigBuilder rigBuilder = GetComponent<RigBuilder>();
    5.             rigBuilder.Build();
    6.             Animator animator = GetComponent<Animator>();
    7.             animator.enabled = true;
    8.         }
    But it doesnt work, the error is still Transform 'XXX' not found in HumanDescription.
    How can I do?
     
  5. CheapMeow

    CheapMeow

    Joined:
    Mar 30, 2021
    Posts:
    4
    Ok, I found reason, I have two same name obj...
    I have known it may be reason but I dont carefully check it out...
    Now everything works...