Incrementing Counter Widget is unexpectedly firing OnSetText handlers on totally unrelated Text Objects

Hello - This is a weird one. I have some hidden text objects in my scene that are used to select color values based on user selections (DataLinq Keys). They enter a team tricode, and the script pulls the hexcode values from a spreadsheet. That part is working great. The scene is a scorebug, and there are completely different text objects in the scorebug that are tied to Widgets, so user can easily advance the score from a DashBoard panel. That all works great, as well. The problem is that when you click one of the Widget controls (Up, Down, or Reset) it is firing the OnSetText scripts which causes a flash in my online scene as the color lookup function runs (the scripts on my hidden objects). This happens whether score counter is adjusted manually in the Sequencer or via the DashBoard panel connected to the score Widgets. Again, these are all totally separate elements in the scene, and I can see no reason why incrementing the Widget is running the OnSetText scripts for totally different scene objects.

I put debug writes in my OnSetText scripts to confirm that they are running when Widgets are adjusted.The log shows them running every time I click scores up, down, or reset them.

Anybody ever seen this or know what the solution is?

Thank you.

Shane Finley

I have also seen this before, its quite annoying.

The only solution I have found takes some work. You need to add old, new, delta objects, and then run a compare and put a condition that only runs the animation if the delta is different.
Others may have a better but solution but that’s what I have ended up doing.

Hi,

Can you elaborate on your solution. I am a little bit confused. I have noticed this same issue on a text object that is supposed to adjust a widget which then causes an infinite loop, which is, uh, not great.

Thanks,
Nathan

Have a visible text object that is not tied to data or widget.

Have a “Old Text” also not connected to data.

Have a script on set text that when it runs checks old text and itself and if they are the same do nothing else run the animation. On the animation have a script that updates old and at the right point of your animation updates the visable text as well. This will give you most control.