I come here today after over 5 hours of failing to debug this problem with my game.
To keep it short, I have a hand animation and a shotgun animation that I am playing at the same time. The shotgun animation also changes a childOf constraint which is connected to an empty that is parented to the IK bone of my rigs hand to simulate him grabbing and hold something.
It’s the way I learned originally to do it by following this tut:
The animation in the viewport plays perfectly:
but when I run the game and activate it with some code:
The shotgun is not following the childOF constraint, but the animation is running as it tilts down a little as it is supposed to.
The rig animation with the hands is looping forever, despite the action actuator being set to play mode as well as me including deactivates in my code for the actuators.
This is the code I am trying to use:
if Type == "dBSS" and holderCatch['Held'] == 0: weaponReact = holderCatch.actuators['WeaponReact'] #holderCatch is the object that is moused over weaponGrab = cont.actuators['WeaponGrab'] weaponGrab.action = "Pickup_dBSS_Bhands" weaponGrab.frameStart = 1 weaponGrab.frameEnd = 36 weaponReact.action = "dBSS_pickup_gun" weaponReact.frameStart = 1 weaponReact.frameEnd = 12 cont.activate(weaponGrab) cont.activate(weaponReact) cont.deactivate(weaponGrab) cont.deactivate(weaponReact) holderCatch['Held'] = 1
The python is connected to some keyboard and mouse sensors and then the two action actuators. It runs everything else as it should, and it throws no errors or warnings when I run and play the animations. The animations are even for sure hitting the deactivates, because the variable after them is updating.
The empty is parented to the correct bone with the armature setting in the object options panel as well. My other animations (walk, throw, jump) all work as supposed to as well.
Hopefully somebody can help with what they think could be causing this issue, as I have run out of ideas.