Play button animation

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
Arctichorse9
Posts: 76
Joined: Wed Sep 25, 2024 11:26 pm
Location: New York City
Contact:

Play button animation

Post by Arctichorse9 »

Hi, I would like a wall button (button is essentially a switch) animation to play before a dialogue triggers but haven't been able to do it. Would I use Set Animatir State? I tried playing a sequence but it didn't work. Thanks for any help.
User avatar
Tony Li
Posts: 23250
Joined: Thu Jul 18, 2013 1:27 pm

Re: Play button animation

Post by Tony Li »

Hi,

There are a few ways you could do this. If you want to handle it all in one Dialogue System Trigger that plays on conversation:

1. Give the wall switch a unique GameObject name such as "Wall Switch 1".

2. Configure the Dialogue System Trigger to play your conversation.

3. Use an empty node (no Dialogue Text) with a Sequence like:

Code: Select all

SetDialoguePanel(false, immediate);
AnimatorTrigger(Flip, Wall Switch 1);
required SetDialoguePanel(true)@2);
Continue()@2
The first line will immediately hide the dialogue UI.

The second line will set Wall Switch 1's "Flip" trigger animator parameter.

The third and fourth lines will show the dialogue UI and continue at the 2-second mark. If you don't require continue button clicks, you can simplify those third and fourth lines down to just:

Code: Select all

SetDialoguePanel(true)@2
Arctichorse9
Posts: 76
Joined: Wed Sep 25, 2024 11:26 pm
Location: New York City
Contact:

Re: Play button animation

Post by Arctichorse9 »

Thank you, I will try this. Just need a little clarification.

The empty node goes in the conversation in the Dialogue Manager?

Before the node with the conversation?

The conversation removes a pillar. Should I put that action in the empty node also?
User avatar
Tony Li
Posts: 23250
Joined: Thu Jul 18, 2013 1:27 pm

Re: Play button animation

Post by Tony Li »

Hi,

Yes to both. Something like:

setdialoguepanelfalse.png
setdialoguepanelfalse.png (26.72 KiB) Viewed 13503 times
Arctichorse9
Posts: 76
Joined: Wed Sep 25, 2024 11:26 pm
Location: New York City
Contact:

Re: Play button animation

Post by Arctichorse9 »

That is very clear. Thank you so much!
Arctichorse9
Posts: 76
Joined: Wed Sep 25, 2024 11:26 pm
Location: New York City
Contact:

Re: Play button animation

Post by Arctichorse9 »

Buttons are animating now correctly. Thanks, as ever! You are the best.
User avatar
Tony Li
Posts: 23250
Joined: Thu Jul 18, 2013 1:27 pm

Re: Play button animation

Post by Tony Li »

Glad I could help!
Post Reply