Lag with copy World Position using python [Fix]

Edit: ah, didn’t read your post correctly. Thought you need a solution but you provided one by yourself.

(Other solution:
Yes, this is the lag of 1 frame you get.

To get this compensated it must be function which you can append to “PreDraw”:

import bge
scene = bge.logic.getCurrentScene()
cont = bge.logic.getCurrentController()
own = cont.owner

ob = scene.objects

cube = ob["Cube"]
sphere = ob["Monkey"]

def copy_location():
    sphere.worldPosition = cube.worldPosition
    
if 'init' not in own:
    scene.pre_draw.append(copy_location)
    own['init']=True

UPBGE 0.36.1
CopyPos_predraw.blend (1021.8 KB)

Luckily you are on UPBGE 0.36 or higher because in 0.3 this was broken…
(I had the same problem for the moving platform in my Cuboid game and found workaround for UPBGE 0.3: