Game Object: scene

scene
  • Returns the scene the game object belongs to.

Return Type:

  • KX_Scene
Sample Code

# import bge
import bge

# get controller
cont = bge.logic.getCurrentController()

# get object that controller is attached to
obj = cont.owner

# get the scene
currentScene = obj.scene