Game Object: worldScale

worldScale
  • gets/sets the game object's world scale

Type:

  • float list [ sx, sy, sz ]
     
  • sx: scale game object's x-axis
     
  • sy: scale game object's y-axis
     
  • sz: scale game object's z-axis
Sample Code

################## get the game object's world scale
 
# import bge
import bge

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

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

# get the world scale
scaleWorld = obj.worldScale

Sample Code

################## set the game object's world scale
 
# import bge
import bge

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

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

# set the game object's world scale
obj.worldScale = [ 2.0, 1.0, 0.5 ]