How to stop an empty from rotating?

I’ve got 4 empties on all sides of the player, and when you press “W” (up) the player should then face that direction and keep a constant speed. (I’ve got an Always - Motion on it)

Unfortunately, due to the fact that the empties are glued to the player, they rotate with it and the player SPINS OUT OF CONTROL, no survivors, etc…

How can I keep them parented to the player, but avoid them from rotating?

Thank you!

would making the player a child of the empties work, or is the player already a child of something else?

If they are parented to the player then they will always rotate with the player. Have you tried to un-parent the empties and use a “copy location” constraint instead?

I’m currently using a cube as my character (only for the moment)
Never used any of the constraints before… so the target is the cube. Why can’t I can’t select anything for vertex?!

By default the ‘copy location’ constraint will copy the target’s “origin” point. If you specify a vertex group in the target object then Blender seems to copy the center of just the vertices in that group. i.e. If you had a humanoid with 2 hands you could make a vertex group with just the right hand vertices and one with just the left hand vertices. Then you could use those vertex groups to copy something to the middle of either hand on the model.

In this case I don’t think you need a vertex group to make the setup work. Check out the attached .blend (made in 2.66a). I actually have 5 empties with the four north/south/east/west Empties parented to a center Empty and then the center copies the location of the cube.


constraint.blend (409 KB)

Perhaps what I’m trying to do won’t work by using this method…

I made the mistake of still having it parented to the cube before using the constraint…
but now the problem I’m getting is when I press W to make the cube face the direction of the empty, it points to where
it’s set BEFORE pressing “P” to start the game

I suppose that it is possible that the “copy location” constraint is not supported in the BGE, I’ve never tried it myself. It is pretty easy to implement in a python controller.

import bge

def main(controller):
  owner = controller.owner

  scene = bge.logic.getCurrentScene()
  cube = scene.objects['Cube']

  owner.worldPosition = cube.worldPosition 

Try vertex parenting the empties to the top vertex of the mesh.