Newbie question about influencing the UI from script

Hi,

I hope you can all tolerate my low level of understanding.

I understand how UI elements can be made to call functions within scripts. What I can’t get my head around ishow to do the reverse. For example, if I had a variable somewhere, and I wanted a toggle control to display the status of that variable, how on earth would I do it?

If anyone can show me, in UnityScript, I’d be most grateful!

I hope I’m allowed to bring this question back to the front page from page three!

You need to write a script and place it on the same GO as the toggle control. This script would reference both the toggle and the script which contains the variable you want to have displayed. You would then need to have a Update function which would constantly look at the variable and assign it to the toggle.