Game Object: localAngularVelocity

localAngularVelocity
  • gets/sets the object's local angular velocity

Type:

  • float list [ x, y, z]
     
  • x = game object's x-axis angular velocity
     
  • y = game object's y-axis angular velocity
     
  • z = game object's z-axis angular velocity
Sample Code

################## get the game object's local angular velocity
 
# import bge
import bge

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

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

# get the local angular velocity
angVel = obj.localAngularVelocity

Sample Code

################## set the game object's local angular velocity
 
# 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 local angular velocity
obj.localAngularVelocity = [ 2.5, 0.0, 0.0]