So I’m working on my third person game project, just trying to refine the movement and control of the character. I’ve got a rig set up where i can rotate a control bone which rotates the head and camera. It works well in animation, but I’m not exactly sure how to set it up so that the bone rotates on the x-axis via mouse control. I have a script that works to rotate an object, but I cant figure out how to attach it to a specific bone. If anyone knows how to achieve this, or just the effect I’m looking for. Please let me know (: Thanks in advanced.
Similar setup to what I have, when I attach my script to the cube, and make it visible, i can see the cube rotating, but the armature/mesh do not follow. This is the script I’m using
from bge import logic as Gfrom bge import events
sensitivity = 10.0
speed = 0.1
owner = G.getCurrentController() .owner
x = 0.5 - G.mouse.position[0]
y = 0.5 - G.mouse.position[1]
if abs(x) > 0.001 : owner.applyRotation([ 0, 0, x], False)
if abs(y) > 0.001 : owner.applyRotation([ -y, 0, 0], True)
G.mouse.position = (0.5,0.5)