Bypass the actuator priority system

Some of you might think this would be a terrible thing to do. I’m pretty new to BGE, so I wouldn’t know. All I know is that the actuator priority system has been firmly obstructing my way when trying to control my animations. So I made a script designed to override it completely.

Variables:


cont = logic.getCurrentController()
acts = cont.actuators

Function definition:


def StartActuator(act):                                # completely bypass the priority system
        for actuator in acts:                            # for each actuator in the actuators list..
            actuator.priority = 2                        # ..lower its priority..
            cont.deactivate(actuator)                    # ..and deactivate it
        
        acts[act].priority = 1                            # set provided actuator to priority 1
        cont.activate(acts[act])                        # ..and activate it

Example function call:


StartActuator('Jump')

I found this script to solve all my problems with animation so far, but if you guys have some arguments against it, I’d love to hear them.