Page 1 of 1

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

Posted: Sat Aug 07, 2021 7:35 am
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

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

Posted: Sat Aug 07, 2021 9:05 am
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.

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

Posted: Sat Aug 07, 2021 10:09 am
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 :)?

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

Posted: Sat Aug 07, 2021 12:18 pm
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.

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

Posted: Sat Aug 07, 2021 7:14 pm
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

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

Posted: Sun Aug 08, 2021 12:43 am
by Tony Li
Hi Pepe,

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