
- gets/sets the object's local Transform
Type:
- float Matrix 4 x 4
- A local transform changes local coordinates, where vertices are defined relative to a model's local origin.
- Gets/Sets the model's scale, orientation and position.

################## get the game object's local transform
# import bge
import bge
# get controller
cont = bge.logic.getCurrentController()
# get object that controller is attached to
obj = cont.owner
# get the local transform
trans = obj.localTransform
################## set the game object's scale on x, y and z
# 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 scale on x, y and z axis to 2.5
obj.localTransform = [[ 2.5, 0.0, 0.0 ,0.0],[ 0.0, 2.5, 0.0, 0.0],[ 0.0, 0.0, 2.5, 0.0],[ 0.0, 0.0, 0.0, 1.0]]
################## set the game object's position on x, y and z axis
# 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 position on x, y and z axis to 3.0, 2.0, 4.5
obj.localTransform = [[ 1.0, 0.0, 0.0 ,3.0],[ 0.0, 1.0, 0.0, 2.0],[ 0.0, 0.0, 1.0, 4.5],[ 0.0, 0.0, 0.0, 1.0]]
################## set the game object's orientation on x, y and z axis
# 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 orientation on y to 45 degrees (uses cosine of the angles)
obj.localTransform = [[ 0.7071, 0.0, 0.7071 ,0.0],[ 0.0, 1.0, 0.0, 0.0],[ -0.7071, 0.0, 0.7071, 0.0],[ 0.0, 0.0, 0.0, 1.0]]
################## set the game object's scale, position, orientation
# 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 orientation on y to 45 degrees (uses cosine of the angles)
# set game object's position to [3.0, 2.0, 4.5]
# set game object's scale to 2 on x, y and z axis ( multiply scale by orientation -- 2.0 * 0.7071)
obj.localTransform = [[ 1.4142, 0.0, 1.4142 ,3.0],[ 0.0, 2.0, 0.0, 3.0],[ -1.4142, 0.0, 1.4142, 4.5],[ 0.0, 0.0, 0.0, 1.0]]