Action: stopAction

stopAction(layer)
  • Stop playing the action in the named layer.

layer:
  • The layer that is playing the action
  • Type:  integer
Sample Code

################## stop playing the action
 
# import bge
import bge

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

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

# stop playing the action in layer 3
obj.stopAction(3)