Copy property values from a different scene

Hi, I’m trying to copy the value of a property from an object that is in a different scene, but it is not working.
I basically want to copy the amount of “Seconds” (integer property) that are on my Hud to my main scene, is it possible? :confused:

This is the logic I’m using:



This logic is in the Main Scene, and the “object” is in an overlay scene.
The “object” property of the Overlay Scene is “Text Game Property”, Integer. (The property of my object in the main scene is also integer type)

example.blend (441 KB)

not sure if the message sensor/actuator will work across scenes.

this is easy in python:

import bge

scene = bge.logic.getSceneList()[0]

owner = bge.logic.getCurrentController().owner

object = scene.objects[owner["OBJECT"]]
property = object[owner["PROPERTY"]]

owner[owner["PROPERTY"]] = property

this script can be used on any object on your HUD scene. hud object requires 2 game properties:

“OBJECT” - a string to tell the script what object to get the property from on the main scene
“PROPERTY” - a string to tell the script what property to copy

I suggest to use messages. Otherwise you get a strong dependency to another scene, which is never a good design.

See:

access the other scene, access the object in the other scene, get its property. done with python.

So it is not possible to copy properties of an object in another scene using only the Property actuator? I think it would be an interesting function… :stuck_out_tongue:

Anyway, thanks for the alternatives!