The Set Scene actuator results in multiple copies of each scene.

BGESetSceneFlaw.001.blend (1.04 MB)

I created a 3D model in cycles, then decided to switch to BGE.
In BGE I created two scenes, each with an overlay scene (so four scenes total). The overlay scenes contain a tab on the left side of the screen to switch to the other scene when the tab is clicked.

Each time I click on a tab in play mode, it switches to the other scene like it is supposed to. The problem is, both scenes are displayed simultaneously. Then switching scenes again results in additional copies of the scenes being displayed (see attached image).

Has anyone seen this before? If so, what did I do to cause it, and how do I correct the problem?

If you decide to download the blend and python files to try it out, use the mouse wheel in the first scene to zoom. In both scenes, click and drag the left mouse button to pitch and rotate the object in the scene.


import bge

# Define global variables
keyboard = bge.logic.keyboard
mouse = bge.logic.mouse  # Use mouse.position[0|1] to get x|y (range is 0.0 to 1.0)

cont = bge.logic.getCurrentController()
own = cont.owner

scene = bge.logic.getCurrentScene()
camera = scene.active_camera

# Define the methods/functions...
#def respondToKeyboardInput():

# END respondToKeyboardInput()

def respondToMouseInput():
    wheelDown = cont.sensors['ZoomCameraOut']
    wheelUp = cont.sensors['ZoomCameraIn']
    currentLens = camera.lens
    if wheelDown.positive:
        currentLens -= 2.0
        if currentLens > 80.0:
            currentLens = 80.0
        camera.lens = currentLens

    if wheelUp.positive:
        currentLens += 2.0
        if currentLens < 20.0:
            currentLens = 20.0
        camera.lens = currentLens

# END respondToMouseInput()


Hi, you just forgot to remove previous scene when you switch: (I added remove scene actuators on overlay scenes buttons)

That works. Thanks.
(Funny, the tutorials I studied never mentioned having to remove the previous scene.)

Add overlay does what the name implies … it adds a scene (unless it is present already).

When you use set scene … it ends the current one and adds the new one instead.

So you can add an overlay scene from your level scene.
You switch scene from within the overlay scenes.

So it is a question of … who does what.