Moving object in circle

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

OS (e.g. Win10): Win10
PsychoPy version (e.g. 1.84.x): v2022.2.5
Standard Standalone? (y/n) If not then what?:
What are you trying to achieve?: Make a object move in a circle

What did you try to make it work?:
I made a object (Pupil_left) and added the followinig code to the builder:

import math

radius = 100
ang_speed = 0.05

angle = 0

def update_position():
    global angle
    x = radius * math.cos(angle)
    y = radius * math.sin(angle)
    angle += ang_speed
    return (x, y)

Pupil_left.pos = update_position()

while True:
    Pupil_left.pos = update_position()

What specifically went wrong when you tried that?:
I get the error:

/* Syntax Error: Fix Python code */

I am not able to find the error.

Import math won’t work online. This might be giving the syntax error, but that’s not an issue if you don’t want to run the experiment online.