Using Button Responses to Increase Size of a Polygon Component

If this template helps then use it. If not then just delete and start from scratch.

OS (e.g. Win10): Win 10
PsychoPy version (e.g. 1.84.x): PsychoPy 2021.2.3
Standard Standalone? (y/n) If not then what?: Y
What are you trying to achieve?: I’m using the Joy Buttons Component and what I’d like it to do is increase the value of a stored variable every time that a specific button is pressed. The variable would then determine the width of a rectangle (Polygon Component) that is on screen.

What did you try to make it work?: I’ve tried creating a Variable Component given the same name as what is listed for Rectangle Width. I see that I can set its starting value, but cannot determine how to use the Joy Buttons Component to increase it’s value on a frame by frame basis. I tried just placing the name of my Joy Buttons Component there and that caused an error, understandably. I also thought that I might be able to create a loop that would constantly reference the datafile that PsychoPy is actively creating and check whether a button press occurred in the previous frame, but that did not work either (Can’t reference the desired file in a loop).

Any ideas? Appreciate the help!