How to experiment with random changes in shape and color of target stimuli in Builer

Hello,

Well, I think I understand what your problem is and what you want to achieve. But I do not see how you have tried to achieve it. You have shown us some code that does not work. You did not show us how you tried to assign the targetshape variable to a component parameter. You did not show us where you put your code (Begin experiment, Begin routine aso.).

You are probably using the polygon component. AFAIK, the polygon component does not allow you to dynamically change the number of its vertices.

https://www.psychopy.org/builder/components/polygon.html

You may want to try another approach.

Best wishes Jens