psychopy.org | Reference | Downloads | Github

Error while defining a variable start time for text component

I am encountering a problem while setting up a variable start time for a component.

I first present a sentence of variable length word by word, and by the time the sentence has been fully presented, I want to have a final blank of 0.5 seconds followed by a prompt. In a code component, I calculate the time at which I wish to display the component by counting the number of words, multiply them by how long they should be displayed, and then I add a small delay.

The trouble I am having is that when I put this variable that I compute in the code component’s start time, I get an error when I run the experiment.

I am very confused by the error message, because it seems like there should be no problem in simply using a variable to set an onset time for a component. Any help would be appreciated.

Thanks

Remove the dollar sign. These fields accept variables by default :+1:

1 Like

Thanks, it worked perfectly!

1 Like