Page 2 of 2
Re: Playing an animation upon starting a dialogue
Posted: Thu Aug 03, 2023 9:19 am
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?
Re: Playing an animation upon starting a dialogue
Posted: Thu Aug 03, 2023 11:55 am
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.
Re: Playing an animation upon starting a dialogue
Posted: Thu Aug 03, 2023 12:28 pm
by Tony Li
Try removing the transition arrow anyway so it doesn't do that.
Re: Playing an animation upon starting a dialogue
Posted: Thu Aug 03, 2023 5:36 pm
by simplepleasuresdxy
Which one do i change? Im still a little confused on what you mean? Im sorry
Re: Playing an animation upon starting a dialogue
Posted: Thu Aug 03, 2023 7:50 pm
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.
Re: Playing an animation upon starting a dialogue
Posted: Thu Aug 03, 2023 8:34 pm
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.
Re: Playing an animation upon starting a dialogue
Posted: Thu Aug 03, 2023 8:41 pm
by simplepleasuresdxy
Okay ... I think I have fixed it, actually. Had to finagle it into working
Re: Playing an animation upon starting a dialogue
Posted: Thu Aug 03, 2023 8:51 pm
by Tony Li
Great! I'm glad you got it working.
Re: Playing an animation upon starting a dialogue
Posted: Wed Aug 09, 2023 7:48 am
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
Re: Playing an animation upon starting a dialogue
Posted: Wed Aug 09, 2023 9:26 am
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.