# How to change the speed of an action in bge without interrupting the loop?

I have an analog controller and I want to change action speed on the runtime, but without interrupting the loop of the action. I tried this but it doesn't work. The loop restart all the time when the variable_that_changes changes.

armature_object.playAction("run",0,30,play_mode = bge.logic.KX_ACTION_MODE_LOOP, speed= variable_that_changes)