Forum rules - please read before posting.

Found issue with hand IK when going from scene to scene.

If I use the action for moving the player hand to an object with IK, I get massively spammed with errors after moving from one scene to another. I am using the release action to remove the IK influence, but it seems that the hand IK weight might only be set to 0, but the target item not purged?

The error:
MissingReferenceException: The object of type 'Transform' has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
UnityEngine.Transform.get_position () (at <21fbbc7e726941fc8413bc76d7177b3f>:0)
AC.IKCommand.OnAnimatorIK (UnityEngine.Animator animator, UnityEngine.AvatarIKGoal avatarIKGoal, AC.IKCommand otherCommand) (at Assets/AdventureCreator/Scripts/Character/IK/IKCommand.cs:104)
AC.IKLimbController.OnAnimatorIK (UnityEngine.Animator animator, UnityEngine.AvatarIKGoal avatarIKGoal) (at Assets/AdventureCreator/Scripts/Character/IK/IKLimbController.cs:74)
AC.Char.OnAnimatorIK (System.Int32 layerIndex) (at Assets/AdventureCreator/Scripts/Character/Char.cs:735)

This is pretty easy to replicate. I get it in scenes where I use the IK to move the hand to a fridge and a door handle.

Comments

  • It seems like a relatively trivial error to fix in a future AC update?

  • edited August 2023

    Oh, when moving from scene to scene, this error seems to prevent the hand IK from reaching other targets anymore. It will reach for the target the hand tried to reach the last time. But not other targets.

  • this fixed it for me. The hand IK now works without fail. I do not like editing AC source code though, but this might be worth pushing in an update.

  • Thanks for the details, I will look into it.

    I can't say for sure if that'll be the official fix, but I will sort the issue out so that you needn't make a similar change after updating.

  • Perfection! This is good as I can then upgrade AC and overwrite this change without worry!

Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.