Hi, I’m trying to get a 2d-like object on an overlay scene to follow a moving object on a main scene. Logic bricks only give me the option of sending it a message. I don’t think I can do a parent across two different scenes.
I thought that if I used Python, I might be able to get the 2d object to follow the object on the other scene by using something like:
from bge import logic <b> Note: The following line is NOT an actual blender function</b> otherscene = logic.getAnotherScene('Scene') scene = logic.getCurrentScene() 2dob = scene.objects['2dobject'] 3dob = otherscene.objects['3dobject'] 3dpos = 3dob.worldPosition <b> The following line probably needs tweaking.</b> 2dob.worldPosition = [3dpos, 3dpos, 0]
from bge import logic as = logic.getSceneList() cs = logic.getCurrentScene() os = as.Scene thpos = cs.objects['2dobject'] ppos = os.objects['3dobject'] thpos.worldPosition = ppos.worldPosition
It didn’t work.