4
$\begingroup$

i want to get object from other scene like this script

scene = GameLogic.getCurrentScene()

player=scene.objects['player']

for example from scene named "Hud"

how can i do it

$\endgroup$
7
$\begingroup$

the scene has to be loaded to have access to :

# to load the scene
bge.logic.addScene('Hud')

#find the scene and object
scenes = bge.logic.getSceneList()
for scene in scenes :
    if scene.name == 'Hud':
        player = scene.objects['player']
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.