KybernetikGames / animancer

Documentation for the Animancer Unity Plugin.
66 stars 8 forks source link

Possible Bug Detected: An End Event did not actually end the animation #279

Closed Jestus closed 1 year ago

Jestus commented 1 year ago

Environment

I have a similar problem to this issue: https://github.com/KybernetikGames/animancer/issues/152

I am doing this:

    public ClipTransition One_Hand_Ready_Shoot_North;
    public ClipTransition One_Hand_Ready_Shoot_East;
    public ClipTransition One_Hand_Ready_Shoot_South;

    public ClipTransition One_Hand_Unready_Shoot_North;
    public ClipTransition One_Hand_Unready_Shoot_East;
    public ClipTransition One_Hand_Unready_Shoot_South;

    private void Awake()
    {
        One_Hand_Ready_Shoot_North.Events.OnEnd = OnReadyAimEnd;
        One_Hand_Ready_Shoot_East.Events.OnEnd = OnReadyAimEnd;
        One_Hand_Ready_Shoot_South.Events.OnEnd = OnReadyAimEnd;

        One_Hand_Unready_Shoot_North.Events.OnEnd = OnUnreadyAimEnd;
        One_Hand_Unready_Shoot_East.Events.OnEnd = OnUnreadyAimEnd;
        One_Hand_Unready_Shoot_South.Events.OnEnd = OnUnreadyAimEnd;
    }

    public void OnReadyAimEnd()
    {
        currentState = AnimState.AIMED;
    }

    public void OnUnreadyAimEnd()
    {
        currentState = AnimState.NOT_ATTACKING;
    }

However I am getting the warning in the title.

It's unclear what is going wrong - I simply want these functions to be triggered on animation end - is that not what's happening here?

Thank you!

KybernetikGames commented 1 year ago

Most of the time end events are used to play another animation but currentState isn't part of Animancer so it doesn't know what you're doing and gives you that warning. If everything is working as intended, just disable the warning as it says.