Question by
RafaelGaju · Oct 28, 2020 at 07:57 AM ·
uibuttonfadetransitionaccessing scripts
UI Button Fade Duration
Hello, how can I access a Button component's Fade duration?
I tried a few things but I can't seem to get it right.
button-options.png
(36.0 kB)
button-documentation.png
(57.1 kB)
Comment
Answer by RonikGr · Apr 15, 2021 at 06:05 AM
[SerializeField] Button button;
public void ChangeFade(float f)
{
ColorBlock cBlock = button.colors;
cBlock.fadeDuration = f;
button.colors = cBlock;
}
Your answer
![](https://koobas.hobune.stream/wayback/20220613014716im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Button Animation Transition Doesn't Work 0 Answers
Button Displacement 0 Answers
Button.OnClick Only Works Once. 0 Answers
Can't disable TMPro Buttons 1 Answer