Routine still continues after continueRoutine = False

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

OS : Win 10
PsychoPy version ): 2023.1.3
Standard Standalone? (y/n) Yes
What are you trying to achieve?:

I am creating a task in which a person intercepts a moving target once it reaches an end target. I am also using a tablet as the trackpad, so there is no mouse component being used, as the cursor instead reads the position from the trackpad.

In a cue routine, the participant is supposed to move into a start box, which will then turn green and the next routine should begin. In the next routine, the moving target appears and starts moving across screen.

I have been unsuccessful in getting the cue routine to end once the cursor is in the start box.

What did you try to make it work?:

I have created code that compares the cursor position to the start box dimensions. If the cursor is outside of the dimensions, the box is yellow and waits for the cursor. once inside, the box turns green and the routine should end. I added continueRoutine = False once the cursor is in the box in an attempt to end the routine then. Below is the code I wrote in the Each Frame tab.

if (xpos > startRight) | (xpos < startLeft) | (ypos > startUp) | (ypos < startDown):
startMouse_2.color = ‘yellow’
leftStart = True
startMouse_2.color = ‘green’
leftStart = False
contineRoutine = False

What specifically went wrong when you tried that?:

The box does turn green once the cursor is inside, but the routine does not end. I am not sure if I wrote the code incorrectly or if there is additional code that needs to be added. Any ideas would be helpful!

Hi cdelaney,

I added continueRoutine = False

This should do the trick. But when looking at your code:

contineRoutine = False

Theres a small typo: Youre missing the ‘u’ in ‘continue’. Fixing it should give you the expected behavior.

Oh wow, thank you! Super simple