Interaction Complete Event Always triggered by animation

sdhains

New member
Regardless of whether you set a fixed duration. The problem is that there is no conditional around setting up the AnimationComplete event handler

EG, my fix looks like this in the Interact.cs:


C#:
   if (m_InteractCompleteEvent.WaitForAnimationEvent)

            {

                EventHandler.RegisterEvent(m_GameObject, "OnAnimatorInteractComplete", InteractComplete);

            }

and in the OnDestroy()

C#:
         if (m_InteractCompleteEvent.WaitForAnimationEvent)
            {
                EventHandler.UnregisterEvent(m_GameObject, "OnAnimatorInteractComplete", InteractComplete);
            }
 
Last edited:
All of the event triggers are setup this way and I was thinking that if you don't want to use the animation event then you'd not send the event via the animation.
 
All of the event triggers are setup this way and I was thinking that if you don't want to use the animation event then you'd not send the event via the animation.

Thanks Justin. Oh ok. So how do you turn off the event being sent through the animation?

The documentation states :

if the ability should wait for the OnAnimatorInteract animation event or wait the
specified amount of time before interacting with the item.

But it is unclear to me where the OnAnimatorInteract event is set up/is coming from.
 
Last edited:
Ok I managed to figure this out thanks to user Cbun on Discord. It is coming from unity's animation events. Click on the animation that is being used for the interaction, scroll down to "events" and you'll see the timeline with a little notch on it.
 
Top