How to delete a drawn line

I have made a line with auto draw True. The line now works exactly how I needed it to be, but I need to add another if statement on overlap with a specific shape to reset the line.

How can I reset a drawn line?

You should just be able to set autoDraw to False to stop it from drawing:

myLine.autoDraw = False

Thank you! For some reason it didn’t work like that. But I’ve created a loop with loads of identical trials and if they’ve finished, it breaks the loop and changes it.

Even then I use autoDraw=False, and win.flip() then change the trial, but there are still small traces in the background of the previous lines.