OS : MacOS Monterey
PsychoPy version: Builder (2021.2.4)
Standard Standalone? (y/n): Yes
What are you trying to achieve?:
I have a simple task, where a number of circles with different colors appear on the screen. The observer has to click on them to make them disappear. After the last circle is clicked, another object appears. The goal is to have an object that has exactly the color of the last clicked circle.
What did you try to make it work?:
In the End Routine tab of the code component, I first get the name of the last stimulus clicked, and I save it. It is then called lastTarget.
Then I need its color and want to get it into a new variable that I can use in the next routine.
I tried:
Color1=lastTarget.fillColor
thisExp.addData(‘Color1’,lastTarget.fillColor)
But nothing happens. First the error indicates that lastTarget is not defined. Additionally, I noticed that when I save the color of one of the circles it is not done by simply saving “blue” or “red” but using the PsychoPy color values such as [-1, 1 -1]. Maybe this cannot be transferred in a variable to the next stimulus.
I also attached the code with a simplified version: Four circles in different colors are displayed. After the last one is clicked, a green triangle appears. However, I want this triangle to have the color of the last circle that was clicked and disappeared.
Code
templateSearch.psyexp (19.0 KB)