Moving bones in BGE - problem

Hi,

So, I started using this forum by bringing problems.

I’m trying to make a suspension in bge, and its deformations will be based on moving a particular bone.

I was looking for functions to get and move single bones and found something (it’s written by me; “up” is
the name of the bone, and “Armature” of the armature):


import bge
import mathutils
scene = bge.logic.getCurrentScene()
armature = scene.objects["Armature"]
armature.channels["up"].location = mathutils.Vector((0, 0.2, 0)) 
armature.update()
print(armature.channels["up"].location)


(I hope you can open it)

The problem is that… it doesn’t move. I tried this script for simpler meshes and also two bones and it worked.
And as you can see the console tells me that my bone has actually moved.

Maybe someone has encountered this problem, I’ll be thankful if you give me a tip or something.

I have the same problem, couldn’t even get just a single bone/armature moving

If you describe your problem, then maybe we’ll be able to help each other. :slight_smile:

I checked it: adding new bones requires adding new vertex groups and declarations for them in script (look at the new file) and that’s all.

bonTest_3bones.blend (67.9 KB)
(I replaced .rotation_euler with .location)

About my problem: it seems that it didn’t work because it didn’t. I removed armature from suspension and added a new one EXACTLY the same and the bone moved. Hilarious. And then I tried to do that in other file and it didn’t. I had to IMPORT the armature that worked to have it done, despite it was the same as that one which didn’t work. :no:

This seems like a very odd problem, there must by a way of starting from the beginning, making a mesh, rigging/skinning and then creating game logic + python script to move multiple bones and change the shape of an armature… We need to hack away as this more I am sure there must be a way, not much resources about it on the net though…