PsychoPy version 2020 1.3
What are you trying to achieve?:
Define a variable at the start of the trial, which is referred to in a polygon component’s position field.
What did you try to make it work?:
I have added a code component to my ‘trial’ routine. Under the ‘begin routine’ I have added:
In my routine, I have added a Polygon component, and in the position field I have added:
Next to this field, I have clicked on the drop-down menu and selected ‘set every repeat’
What specifically went wrong when you tried that?:
When I run this, the polygon doesn’t appear, and I receive the message:
NameError: name ‘targetPos’ is not defined
However, when I define targetPos under the ‘BeginExperiment’ tab in the code component, it works.
As you can see, I am very new to using the builder! Thank you for your help with this very newby question.