Constraint breaks after pressing P

Hi everybody.
I have a character who’s eyes are a different object. The rig consist basically of an armature that has both object skinned (body and eyes, the eyes are only parented to the head bone) and an empty that has both eyes constrainted with “track to”, so this empty rotate the eyes and points where the character is looking while the head bone stick the eyes inside the head with the parent. This works perfectly in blender and for animation but for some reaseon after pressing P the eye constraint simply breaks (they don’t follow the empty). I suppose it is because the eyes are a different object, cause the other empty which has the head bone constrainted for head direction doesn’t break after pressing P. Any ideas? Why does the constraint break for the eye object and doesn’t for the head bone if both are constrainted to empties? Do I have to constraint only bones?

thank you. Sorry if my explanation is too confusing my english isn’t perfect.

Ahh in summary, I wan’t to have the eyes parented only to the head bone, and have a “track to” constraint for rotation that doesn’t break after pressing P.

David,.

Most constraints don’t work in the BGE- on each eye you need an edit object actuator, set to track to, and the object you want (of course, also linked to an always sensor and some sort of controller)

For eye’s what I do is make bones for the eyes (each eye) which are parented to the head. next make two more bones in front of the face aligned with the center of each eye, I name them “gaze.” I don’t have blender on this computer but I believe you add a track to constraint to each eye’s “gaze” then add one more bone between each “gaze” and call it “gaze control” and make it the parent of each “gaze” that way you can control both eyes at once or individually. everything can be a separate object.

I believe your problem is the fact that you’re using empties to control the armature, I don’t remember that working in real time, it sucks because that’s so many things you do gone right down the drain.

Just in terms of controlling eyes, don’t make 2 separate bones for them to track to- it will look unnatural if the eyes don’t slightly cross (after all, they both have to look at one single point, unless the character is supposed to be cockeyed) and if you want to control them individually (have them roll separately all creepy-like, for example) it’s probably better to just manually rotate them anyways.

If you make each eye its own object (with the center at the center of the eye) and parent them to the head bone, tracking an empty with the actuator will work just fine in real-time. If you also use a constraint they’ll work in the preview as well, with the same-looking results.

Thank you both. This is what I needed.
:slight_smile: