Page 1 of 1

Code in "sequence" running after OnConversationEnd()

Posted: Thu Dec 21, 2023 9:48 am
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.

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

Posted: Thu Dec 21, 2023 9:58 am
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.

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

Posted: Thu Dec 21, 2023 3:17 pm
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()