Cannot get opacity to update

For the life of me I cannot get the opacity to update. I have tried using a variable in the opacity box, then updating it in the code. I’ve tried using an interval loop in the Begin Routine and setting the update to set every repeat. I’m just not getting any results.

I have this in the

Begin Routine:

timer = new util.Clock();

Each Frame:

                    if (timer.getTime()>2 && timer.getTime()<10)  //After 2 seconds, set opacity to 0
                        {
                       polygon_2.opacity=0;
                        }

                     if (timer.getTime()>=10) //Every 10 seconds, set opacity to 1
                      {
                        ++currentInterval;
                        polygon_2.opacity=1;
                        console.log("test");
                        timer.reset();
                        }

I get “test” to appear every 10 seconds, but I cannot get my visualstimulus to change opacity. Anyone have any ideas?

Try polygon_2.setOpacity(0)

with opacity in the component set to constant

1 Like

Perfect! It is working just fine now. Thank you for the input.