Issues with creating a user interface in BGE

Hello again!

Thanks to all that helped me out previously. Now, I have another question. For this particular game, I am trying to create a basic user interface that rotates the camera clockwise and counterclockwise, depending on what button is moused over.

Problem is, when I run the game, the plane objects move with the camera, as they are both parented to it. What appears to be happening is that they move to the camera as well, making them impossible to interact with after mousing over them the first time.

Attached is the .blend file, as I think this is better seen than read about.
Level1_Camera.blend (625 KB)

This is a lazy answer, but it may just help you. I see your problem, but I really do not understand the interaction between your animation and how things are displayed.

However, the way I generally set up things like UI’s and HUD’s is with scene overlays. It makes the interaction between different parts of the logic a little more complicated (not really, you just have to use message actuators), but it simplifies the relationship between the camera and the UI. No parenting or thinking about relationships between different coordinate spaces necessary :slight_smile:

Here is a very simple example of a scene based HUD. Again, it does not directly address the strangeness of how the panels move in relation to the camera, but if you set things up this way, you do not have worry about how parenting is effecting the animations.

Attachments

simpleHud.blend (480 KB)

Hello there, I haven’t messed with blender in awhile and i could be wrong, but i took a look at you’re file and it seems like you gave your buttons animations as well as being parented to the camera.

Going with one or the other should work, but you’ll have to make a new animation for the buttons if you want it animated, you’re using the camera’s animation on them. I don’t know much of how blender works, but the way you have the buttons set up probably follow the camera to the new position then offsets themselves another rotation because of the animation they have and that’s why the disappear from view.

If it was me I’d probably just get rid of the action actuator on the planes and it should work alright, I hope that helps :slight_smile:

This is correct. Since the planes are parented to the camera, they will stay in front of the camera when the camera is moved.