Code in "sequence" running after OnConversationEnd()

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
perezbalen
Posts: 40
Joined: Mon May 24, 2021 7:22 pm

Code in "sequence" running after OnConversationEnd()

Post by perezbalen »

Hi.
In some of my dialogue nodes, I have sequences that call AnimatorPlay.
But I'm also using the DIalogue System Events on the Dialogue Manager, and the OnConversationEnd() invokes an event.
The thing is that when I have an AnimatorPlay on the last node of a conversation, I found that the OnConversationEnd is being invoked before the AnimatorPlay (first the conversation ends, and after that, the AnimationPlay is run), which seems counter intuitive to me. Am I doing something wrong?
If this is normal, is there a way to force the AnimatorPlay on the last node to run before the OnConversationEnd event is invoked?
Thanks.
User avatar
Tony Li
Posts: 21678
Joined: Thu Jul 18, 2013 1:27 pm

Re: Code in "sequence" running after OnConversationEnd()

Post by Tony Li »

Hi,

All sequencer commands should run before the OnConversationEnd event occurs. Is it possible that the animator is just in the process of transitioning to the requested animator state?

If you want the last node to wait for the animation to finish before the conversation ends, you can use AnimatorPlayWait() instead.
perezbalen
Posts: 40
Joined: Mon May 24, 2021 7:22 pm

Re: Code in "sequence" running after OnConversationEnd()

Post by perezbalen »

Thanks
I misspoke (miswrote?). I'm not using AnimatorPlay but AnimatorTrigger.
Yet I found the problem, for anyone searching the forums. My transitions had the hasExitTIme checkbox checked, even though the transition exit time was set to 0, it wasn't happening instantly. removing that made the trigger trigger instantly and not before the onConversationEnd()
Post Reply