Forum rules - please read before posting.

Head-turning action with "Wait until finish?" hangs game

Hi,

after updating AC from version 1.74.2 to 1.74.5 all "Character: Face object" actions that use the "Wait until finish?" option hang the game. Sometimes those actions take from 30 seconds up to several minutes until the action list continues and in rare cases the game simply hangs and the action list won't continue at all.
I just verified this by reinstalling a 20 days old version of the project where AC 1.74.2 still was used and it works as expected (characters look where they should look and it only takes millisecs). After updating this project to 1.74.5 it stops working. The character still looks in the right direction, but the
Let's see what informations I can give about this: I use mecanim 3d characters with a blend tree for head-turning using the yaw and pitch variables in the mecanim fields of the Player component. The Unity version is 2018.4.36f1.

Mac

PS: Just found where the problem is: The function "IsMovingHead()" in the "Char.cs" script does not work with my setup I guess. I copied the old version (that uses Math.Abs instead of Math.Approximately) over and everything works again.

Comments

  • Thanks for the details, and apologies for the trouble.

    v1.74.3 made changes to the IK system to fix a related issue. I will look into this to find a way to resolve both.

  • edited December 2021

    Hi @MAC, I'm afraid I'm having trouble recreating the issue, but the change you mention was made to avoid a "snapping" effect when the comparison threshold was too great.

    I'm hoping that lowering this value should be enough to sort both issues. Would you mind testing this replacement for the IsMovingHead function?

    public bool IsMovingHead ()
    {
        if (Mathf.Abs (actualHeadAngles.x - targetHeadAngles.x) < 0.02f &&
            Mathf.Abs (actualHeadAngles.y - targetHeadAngles.y) < 0.02f)
        {
            return false;
        }
        return true;
    }
    
  • Thanks, it works well with this value. It even works with 0.002f.

    Out of curiosity I switched the value with Mathf.Epsilon, which should be the value that Mathf.Approximately uses as far as I understood and it stops working.

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.