Can't change polygon position in Code Component if position is set as "set every repeat" in Builder

Hi all,
I’m using a loop in the builder to iterate over different images with different bounding boxes. I have the images and the bounding boxes properties set as “set every repeat” since these values are accessed from the condition excel file.
I’m trying to update the position of a polygon to move it where the mouse has been clicked, but with no success.
The code snippet is this:

  elif mouse.getPressed()[0] and confirmed_position==False:
      agreed_with_model.append(0)
      confirmed_position_times.append(0)
      rejected_position=True
      button.opacity=0
      trial_confirm.opacity=0
      mouse_pos=mouse.getPos()
      mouse_x=mouse_pos[0]*win.size[1]
      mouse_y=mouse_pos[1]*win.size[1]
      mouse_new=[mouse_x,mouse_y]
      box.pos = mouse_new
      box.setPos([mouse_x,mouse_y])
      return time_remaining

I can change the properties of object that are set as “constant”, but not if they are set as “set every repeat” or “every frame”
I even tried to set the properties as “set every frame” and change the value of the variable used in the builder (e.g. the position uses the variable in the excel “placed_x, placed_y”, so I tried to change those variable in the code component), but with no success.
Can you help?
Thanks a lot

Dear Dario,

You would need add some additional detail for what happens when “it doesn’t work”. Is there an error output? Does nothing happen? Does it crash?

What is the purpose of “rejected_position = True”?
To better troubleshoot, I would add some print statements to make sure variables are being correctly identified. Specifically, making sure the values for mouse_pos, mouse_x, and mouse_y are correctly defined.

Also, is the name of the mouse component the same as in your code?

Issac