Trigger a Button Click

Hi, I want to make a script so that when I click one button, another button is clicked. I don’t just want the script of the other button to run, I want to see the color of the second button change when I click the first button. I code in C#. Does anybody know how to do this? I’ve already looked online for things like this, and I found scripts that trigger buttons, but none where you can actually see the color of the button change.

Thanks!

You can use the submitHandler

BaseEventData data = new BaseEventData (EventSystem.current);
ExecuteEvents.Execute (secondButton.gameObject, data, ExecuteEvents.submitHandler);

Hello ! did you try this ?

 secondButton.getComponent<Button>().Select(); // it will highlight the button 

Otherwise you can modify the color of the second button like this :

 secondButton.image.color = newColor;