Action: getActionFrame

getActionFrame(layer)
  • Gets the current frame of the action that is playing in the supplied layer.
  • Return Type:  float

layer:
  • The layer that you want to get the frame from.
  • Type:  integer
Sample Code

################## get the current frame of the action that is playing
 
# import bge
import bge

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

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

# get current frame from layer 3
frame = obj.getActionFrame(3)