Playing an animation upon starting a dialogue

Announcements, support questions, and discussion for the Dialogue System.
User avatar
Tony Li
Posts: 21681
Joined: Thu Jul 18, 2013 1:27 pm

Re: Playing an animation upon starting a dialogue

Post by Tony Li »

Keep the Animator window open on your Blur GameObject. Does it transition into the animation state(s) you want and stay there? Or does a transition arrow make it transition back to some state you don't want?
simplepleasuresdxy
Posts: 73
Joined: Tue Jul 25, 2023 1:34 am

Re: Playing an animation upon starting a dialogue

Post by simplepleasuresdxy »

Well the last time it worked, it played the blurring animation (which is just the image going from transparent to fully visible) but it returned to ita original state.
User avatar
Tony Li
Posts: 21681
Joined: Thu Jul 18, 2013 1:27 pm

Re: Playing an animation upon starting a dialogue

Post by Tony Li »

Try removing the transition arrow anyway so it doesn't do that.
simplepleasuresdxy
Posts: 73
Joined: Tue Jul 25, 2023 1:34 am

Re: Playing an animation upon starting a dialogue

Post by simplepleasuresdxy »

Which one do i change? Im still a little confused on what you mean? Im sorry
User avatar
Tony Li
Posts: 21681
Joined: Thu Jul 18, 2013 1:27 pm

Re: Playing an animation upon starting a dialogue

Post by Tony Li »

Hi,

I'm making three assumptions:

1. Your GameObject is named "Blur".

2. The animator controller assigned to the GameObject's Animator is set up like in your previous screenshot. This has an animation state named Blur that links to an animation state named Blurred.

3. When the animation clip assigned to the Blur state is done, the arrow leading from Blur to Blurred switches the Animator to the Blurred state's animation clip.

If this is the case, then make sure the Blurred state does what you want it to do -- presumably to keep the image blurred.
simplepleasuresdxy
Posts: 73
Joined: Tue Jul 25, 2023 1:34 am

Re: Playing an animation upon starting a dialogue

Post by simplepleasuresdxy »

OKay yes, I think I see how it works. How do I change the "Blurred" state then? I'm looking online and I'm getting a bit of information overload.
simplepleasuresdxy
Posts: 73
Joined: Tue Jul 25, 2023 1:34 am

Re: Playing an animation upon starting a dialogue

Post by simplepleasuresdxy »

Okay ... I think I have fixed it, actually. Had to finagle it into working
User avatar
Tony Li
Posts: 21681
Joined: Thu Jul 18, 2013 1:27 pm

Re: Playing an animation upon starting a dialogue

Post by Tony Li »

Great! I'm glad you got it working.
jonestruckzs
Posts: 1
Joined: Wed Aug 09, 2023 7:47 am

Re: Playing an animation upon starting a dialogue

Post by jonestruckzs »

I'm still having trouble with panels and I just think it would be easier if I just had it where I invoked an animation for a separate element
User avatar
Tony Li
Posts: 21681
Joined: Thu Jul 18, 2013 1:27 pm

Re: Playing an animation upon starting a dialogue

Post by Tony Li »

In that case, if you need to do this in a specific dialogue entry you can use AnimatorPlay() sequencer command.

If you need to do it whenever the dialogue UI opens, the Dialogue Panel has a UI Panel component. This component has OnOpen() and OnClose() UnityEvents. You can invoke the blur in the OnOpen() UnityEvent.
Post Reply