Armature actuator rotate\move bones with mouse

Happy New Year to all! :slight_smile:

I have few (newbie) questions again. Hope you will help me as always. First question is about armature actuator, i’ve googled but not very successfull. I have character with armature, have animation and set up of controls to move my character. Camera is in 3rd person view, so i want my camera not only turn my character (root_bone or dummy to which armature is parented) but also turn the head of my character. So when you move mouse to say left, head of my character should folow camera turning left, and then when head is turned tosay 45% whole armature is turning left.

What i did: i’ve created object (box) linked it with neck bone and put ‘copy rotation constraint’ on neck bone copying rotation of the box. Then i put logic bricks “mouse sensor -> and > mouse movement” to the box , set min max angles to 45 degrees preventing head rotating 360 degrees . And then put ‘armature actuator’ to armature with option ‘run’. And it’s worked. Neck is rotating with mouse movement. Not sure if i have made it right way but it worked.

So question is. How to make body turn (folowing mouse movement) only after neck is reached maximum angle specified in it’s movement actuator?

And next question: I can rotate any bone with such method by mouse movement, but what if i want to MOVE some IK bone with mouse movement? Is that possible? I managed to move IK bone with keyboard but it would be nice to use mouse. Some kind of drag and drop feature not for physical objects but for IK bones of character.
Is armature actuator is supposed to “activate” constraints applyed to one or more bones of armature?
Is there good tutorials for using constraints in BGE (i have read that not all constraints are supported by BGE) and armature actuator to learn more about its settings and how it’s working?

check out simple_mouse

you can use a prop to drive a animation in property mode

you could also use copy rotation constraint and use the value to manipulate the rotations of a target object without an animation

(like a empty parented to the same hitbox as armature)

rot = hitBox.worldOrientation.to_euler()
rot.z += mouseObject[‘x’]
empty.worldOrientation=rot

Thank you BluePrint for idea, but couldn’t you to make simple .blend example when you will have free time, so i could see how it’s working, cause i realy new to BGE and know nothing about Python coding. I don’t even get where to put your code. Though i feel shame for that, i definitly should learn Python. :eek:

Here is simple example. Armature actuator.blend (1.4 MB) Mouse is rotating Player (collision box) and also mouse is rotating neck IK controller. But neck is rotating weirdly (if i switch off mouse actuator from Player neck is rotating as intended). So i don’t get how to make it work properly.

actually you can just use the property from the mouse property generator

mouse move-----and--------property actuator copy mode, simplemouse prop x
x changed-----and----play action property mode using x