"Pressed" transition(colour tint/animation) not happening when pressing a response button.

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
PepeJEe
Posts: 18
Joined: Sat Apr 24, 2021 8:39 am

"Pressed" transition(colour tint/animation) not happening when pressing a response button.

Post by PepeJEe »

Hey, I am setting up my own UI and I want to have pressed animation or colour tint. Now for some reason it's not working, when i press the button it only disappears.

Here is a drive link for all my dialogue settings. Also im using the colour tint, so it should turn red when i press the button, but it won't, you can see it happening from the video. Recommend downloading the video, bcs inside google drive it's only 360p.

https://drive.google.com/file/d/1ylgU1Y ... sp=sharing

Just realized, it does the pressed transition when using mouse to navigate, but i want it to work with arrows/enter.


-Pepe
User avatar
Tony Li
Posts: 22148
Joined: Thu Jul 18, 2013 1:27 pm

Re: "Pressed" transition(colour tint/animation) not happening when pressing a response button.

Post by Tony Li »

Hi Pepe,

That's just the way Unity UI works with keyboard/joystick navigation. It doesn't have anything to do with the Dialogue System. You could write a script to make it briefly show the clicked state. See the UIButtonKeyTrigger.cs script for some example code that you could use.
PepeJEe
Posts: 18
Joined: Sat Apr 24, 2021 8:39 am

Re: "Pressed" transition(colour tint/animation) not happening when pressing a response button.

Post by PepeJEe »

Thank you Tony! Weird thing is pressed animation doesnt work in the dialogue, but it works in my main menu screen. Well i'll try to figure that out somehow.

Another quick question: When I press play, weird 3 objects will pop up in the Dontdestroyonload, should they be there? Do i need them, if not how can i remove them :)?
Attachments
screeenshot.PNG
screeenshot.PNG (14.3 KiB) Viewed 851 times
User avatar
Tony Li
Posts: 22148
Joined: Thu Jul 18, 2013 1:27 pm

Re: "Pressed" transition(colour tint/animation) not happening when pressing a response button.

Post by Tony Li »

PepeJEe wrote: Sat Aug 07, 2021 10:09 amAnother quick question: When I press play, weird 3 objects will pop up in the Dontdestroyonload, should they be there? Do i need them, if not how can i remove them :)?
The Dialogue Manager's Instantiate Prefabs component is instantiating them. You can disable or remove the Instantiate Prefabs component, or clear its Prefabs list.
PepeJEe
Posts: 18
Joined: Sat Apr 24, 2021 8:39 am

Re: "Pressed" transition(colour tint/animation) not happening when pressing a response button.

Post by PepeJEe »

Thank you Tony, i got them removed :)

Also I added "Play pressed animation" into OnClick event for the buttons, and now it works perfectly :) I had to tweak the animator a little bit :D

-Pepe
User avatar
Tony Li
Posts: 22148
Joined: Thu Jul 18, 2013 1:27 pm

Re: "Pressed" transition(colour tint/animation) not happening when pressing a response button.

Post by Tony Li »

Hi Pepe,

Great! Glad you got it working the way you want.
Post Reply