Hi Weronika. Please indent your code with four spaces of surround a block of code by ``` before and after to make it more readable.
There are a couple of issues here. One is that you are trying to create a mouse object on every screen refresh. It should just be created once on a given routine, and then you can refer to it as needed. I’m guessing that you already have an object called
mouse but then you are effectively re-assigning with this statement, to something that is probably
mouse = mouse.setPos(newPos=(0,0))
Instead, I guess you just want to reset the mouse position once, at the start of the routine. So put the code in that tab of the code component, rather than on the “every refresh” tab. i.e. even if the code worked, you would effectively be keeping the mouse static and preventing it from moving because you would continually be re-zeroing it. So the code would just be this:
i.e. you just need to update an attribute of the mouse, not recreate it (this assumes that you already have a mouse defined).