Blender Game. My Game does not move when executing but it goes to the final position when I stop it I'm trying to create a simulation in blender of a person walking.
I did a program to advance one leg 1 degree (and return the other 1 deg) after pressing the space bar but I can't see the advance while the game is executing and instead of that, I see the movement until I stop the game. I think it could be because of the pose mode. But I'm not sure. No error is displayed in the console while executing.
I attach some pictures and the code:

Before running the game:


While running the game nothing moves.


When I stop it after pressing the Spacebar a few times and it leaves the executing screen it appears it what I think is the final position, but nothing happens while executing.


Logic Editor:


Code:


    import math
    import bpy
    import numpy as np
    import bge
    from bge import logic

    controller = logic.getCurrentController()
    own = controller.owner
    
    sensors=own.sensors

    #CODE PART 1. ROTATION
    ob = bpy.data.objects['Armature']
    bpy.context.scene.objects.active = ob
    bpy.ops.object.mode_set(mode='OBJECT')
    
    rhip = ob.pose.bones['Thigh.R']
    rleg = ob.pose.bones['Leg.R']
    rfoot= ob.pose.bones['Foot.R']
    
    lhip = ob.pose.bones['Thigh.L']
    lleg = ob.pose.bones['Leg.L']
    lfoot= ob.pose.bones['Foot.L']
    
    # Set rotation mode to Euler XYZ, easier to understand
    # than default quaternions
    rhip.rotation_mode = 'XYZ'
    rleg.rotation_mode = 'XYZ'
    rfoot.rotation_mode = 'XYZ'
    lhip.rotation_mode = 'XYZ'
    lleg.rotation_mode = 'XYZ'
    lfoot.rotation_mode = 'XYZ'
    
    # select axis in ['X','Y','Z']  &lt;--bone local
    axis = 'Z'
    actual_angle = [0,0,0,0,0,0]
    
    def refresh_angle():
        global actual_angle
        lecture=[1,1,1,-1,-1,-1]
        angle=np.array(lecture)-np.array(actual_angle)
        
        rhip.rotation_euler.rotate_axis(axis, math.radians(angle[0]))
        rleg.rotation_euler.rotate_axis(axis, math.radians(angle[1]))
        rfoot.rotation_euler.rotate_axis(axis, math.radians(angle[2]))
        lhip.rotation_euler.rotate_axis(axis, math.radians(angle[3]))
        lleg.rotation_euler.rotate_axis(axis, math.radians(angle[4]))
        lfoot.rotation_euler.rotate_axis(axis, math.radians(angle[5]))
        
        actual_angle=angle
    
    
    if sensors[&quot;Spacebar&quot;].positive:
         refresh_angle()
While in the related question i test channel.location.x += 0.1 and channel.location.x += 0.1 but none work all time print (0,0,0) (i try because i never has move a bone), so i read the armature documentation and location. Finally end up with this script.

from bge import logic

armature = logic.getCurrentController().owner
if not hasattr(logic, 'boneLocation'):
    logic.boneLocation = 0
else:
    logic.boneLocation += 0.5
    channel = armature.channels["moveBone.003"]
    channel.location = [logic.boneLocation, 0, 1]
    print(channel.location)
    logic.getCurrentController().owner.update()


Blender Game Engine Started
&lt;Vector (0.5000, 0.0000, 1.0000)&gt;
&lt;Vector (1.0000, 0.0000, 1.0000)&gt;
&lt;Vector (1.5000, 0.0000, 1.0000)&gt;
&lt;Vector (2.0000, 0.0000, 1.0000)&gt;
&lt;Vector (2.5000, 0.0000, 1.0000)&gt;
&lt;Vector (3.0000, 0.0000, 1.0000)&gt;
&lt;Vector (3.5000, 0.0000, 1.0000)&gt;
&lt;Vector (4.0000, 0.0000, 1.0000)&gt;