If you want to use a precise Location of your character at any frame and get rid of that ugly
effect due to using a single constant speed for the whole animation (that u can see in many games even Blockbusters like Skyrim) , you can bake the Speed ( = the Delta between 2 frame) onto any dummy bone . And then, read the Bone pose (Local loc & rot) during game to feed your Motion Actuator
arm = scene.objects["Armature"]
b = arm.channels["dummy bone"]
## rotation of the character has been coded on the Y Rot channel
## (this is for animations in which the character turns)
z = b.rotation_euler[1]
## speed has been coded on the Y Loc channel
_, y , _ = b.location
### if your animation frame rate is set to 30 and u don't use fix FrameRate option ... u can ajust with something like this
speed = y * 30 / (bge.logic.getAverageFrameRate() +1 )
mot.dLoc = [0.0 , speed, 0.0 ]
So with that, the Speed of your character can variate when running an animation and is no longer constant.
N.B : what i was doing before was to put the speed variation on the Root Ground bone … but as such, the Armature was getting out of the Player Box in acceleration and de-acceleration … so it was bad on the matter of collision … But here above, the variation is on the player and no longer the Armature, and so, the collision is always accurate if any ; the character is always in the box