Game Object: getAngularVelocity

getAngularVelocity(local)
  • Returns the angular velocity of the object center using either the World axis or the Game Object axis.

Return Type:

  • List [ x, y ,z]
  • x = float (angular velocity around x-axis)
  • y = float (angular velocity around y-axis)
  • z = float (angular velocity around z-axis)

local:

  • axis (world or local)
  • Type:  boolean
  • world axis: 0 or False
  • local axis: 1 or True
Note:
  • Object types: Dynamic and Rigid body
Sample Code

################## get the angular velocity
  

# import bge
import bge

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

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

# get angular velocity around game object axis
angVel = obj.getAngularVelocity(True)