Arms, Armatures, and Firearms

I’ve encountered a problem when creating 3rd person games, or enemies who need to aim up and down. I can make them aim at an object, but only in two dimensions (at least without making them lean forward and backward).
I think I can create an empty that will track in full 3D, parented to the enemy/character object, but while bullets may fly correctly, the arms of said character don’t aim accordingly. A script may be able to capture the orientation of the 3D-aiming empty, and turn it into a property for the armature to work with, but I know next to no scripting. Any ideas?

You can use a Track To constraint on a bone to track it towards an object (a head to something of interest, or arms towards something to aim at, etc.).

Okay, thanks, but it didn’t work. The constraint worked in real time, but only in the 3D window. In the game engine, the constraint still had a visible effect, but the bone still aimed at where the target object was upon the start of the simulation, as though it wasn’t updating the object’s location. Again, though, thanks. It seems to work for some people, and it’s closer than I seemed to be able to get.

Hm. It worked for me - try applying the Constraint actuator set to an Always sensor. Maybe that’s why my setup worked.

Clearly, in the couple of years of toying with the game engine, I have been reluctant to further explore the use of constraints in games. We are still talking about the constraints in the objects window, and not the regular actuator, right? Or is there a constraint actuator that integrates the two? I’ll try looking around for some tutorials while fiddling with it.

EDIT: Doh, I messed up - in the Armature actuator, there’s a mode for setting bones to target objects (Set Target). That should help you out. You may still need an actual constraint to make it work, though (there’s a property in the actuator).

Yeah, I’m just lost. I don’t see any armature actuator. Unless you meant the action actuator, in which case I’m still just as lost. Is there a tutorial for this? What version of Blender are you using? I’m still using 2.49.

Oh dear :O… At some point your going to need to make the leap over to the new stable version, 2.57 that is. For me, it didnt take much to start liking and using the newer version more efficently. Make the leap, and youll be happy you did :wink:

EDIT: I found the armature actuator, but its in the newer version :confused: Guess youll have to download it :smiley: good day.


Thanks, I may have to take a whack at it. I’m just worried that some of the scripts I’ve downloaded will become defunct in the process, or that the impossible will happen and my Windows Vista might give me problems with three different generations of the program (I’m a bit of a pack rat… 2.47 is still somewhere in my documents).

I, too, would recommend the 2.5 version. The scripts most likely will not work with the new 2.5 API, but porting the scripts isn’t too hard of a task.

“Porting the scripts isn’t too hard of a task,” is a bit of a suspect claim, as I don’t even know what that means. Still, I have to update eventually, and it seems it will open up quite a few entertaining opportunities. I’ll report back when I’ve updated, and if I have any problems. Thanks, by the way.

… S. S… SUSPECT?! Oh, no, the jig is up! LOL - I’m just kidding. Really, though, porting scripts aren’t too difficult to do - Blender 2.5 uses different module names and doesn’t refer to objects as “OBName”, but just “Name”. That’s kind of it (there’s also a difference in referring to variables, but that was done in 2.49).

Wait WTF!!!

Armature Actuators for real-time tracking in GE?!?!!?

Where have I been?!?!

I don’t know where you’ve been - shouldn’t you know that? LOL - Just kidding. Yeah, armatures can track to things now in the BGE. I can confirm, as I have a character being able to look at the camera while walking around.

is there a way to control influence via sensor?

Control influence… You mean turn it off if a sensor is true? I think there’s a menu in the Armature actuator that triggers the constraint - if you tie that to a sensor, it should work.

couldnt you just two armatures - armature 1 legs and hips
armature 2 upper body (important bit , origion set at the hips or spine for rotation around that point)

then you could set a rotation for up and down

or even set a track to to an empty , n it should work cause the rotation point is at the origion which should be at the spine where it meets armature 1 , correct me if im wrong , cause i really want to know this
, and the weights shouldnt be affected cause u can weight oon two armatures with the one mesh, just parent the two armatures at the same time to the the mesh