Move bone and armature to target object

I just find code from MarcoIT here in blenderartist.org and change to my objects no errors in console but not move armature and bone to target object

anybody can help?

import bge
from mathutils import Matrix, Quaternion, Euler, Vector
import random


def up(cont):
arm = cont.owner
bone = arm.channels["Bone.002"]
target = arm.scene.objects["Cone"]

m4_in_arm = arm.worldTransform.inverted() * target.worldTransform


################################## remove (or should) the offset of the bone
q_offset = Quaternion(bone.rotation_quaternion)
p_offset = Vector(bone.location)
m4_offset = q_offset.to_matrix().to_4x4()
m4_offset.translation = p_offset
offset_inv = m4_offset.inverted()
bone_pose_matrix_without_offset = bone.pose_matrix * offset_inv
##################################


m4tbone = bone_pose_matrix_without_offset.inverted() * m4_in_arm

p,q,s = m4tbone.decompose()
bone.location = p # copy the position of the target 
bone.rotation_quaternion = q # copy the rotation of the target
arm.update()

use [CODE*] [/CODE*] tags. remove the *

i dont know what you telling friend please clarify here

He wants to tell you that your code snippet is not formatted in a useful form. When you surround it with [noparse]


[/noparse] tags the formatting will be preserved. Please edit your top post.

Hint there is a button to add code tags when you use the advanced edit mode.

thank you friend but why BGE dont advance with ragdolls? may be industry of games block devlopments of BGE to stop in 2011?

spawn ragdoll may be around 2.7XX would be work with certificated addon ;(