Game Object: setOcclusion

setOcclusion(parent, children)
  • Set occlusion culling on the game object and children.

parent:

  • Set occlusion culling on the game object.
  • Type:  boolean
  • enabled: 1 or True
  • disabled: 0 or False
children:
  • set occlusion culling on game object's children
  • Type:  boolean
  • enabled: 1 or True
  • disabled: 0 or False
Note:
  • Occlusion Culling disables rendering of objects when they are hidden behind other objects.
Sample Code

################## set the occlusion culling
  

# import bge
import bge

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

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

# set occlusion on game object
parent = True

# set occlusion on game object's children
children = True

# set occlusion culling
obj.setOcclusion(parent, children)