2D interface perpendicular to camera

Hi. I have a problem trying to put a 2D interface on my game. It should stay still at the bottom of the screen.

I tried to parent a plane to the camera, and it works ok in Blender (in the editor), but when I run the BGE, the plane starts moving around and doesn’t stay with the camera (which is animated with an IPO). I also tried the track constriction, but its even worse.

I’ve been doing searches on this forum and on Google, but I didn’t find anything :frowning:
Any ideas?

Thank you.

“Parent” should work in the game engine…in a “normal” situation!
Post a .blend, maybe?!

Well if you select the plane, then the camera, then hit Ctrl+P it should move with the camera, aka sit still.

If I may see the file, I could probably fix it.

a 2D interface is best done with an overlay scene IMO

Parent should work, just make sure that there isn’t a delay set between the object and the parent…

Thanks for your replies. I tried to make a new camera, parent it to the plane, and it’s working now.
Anyway, it seems my camera was broken. I made a small blend file so you can see what happens (if you want). If you go forward (right arrowkey) you can see the plane is moving ok. But if you play the animation (hit C to move the camera) you will see the plane is not correctly attached.


camera_test.blend (168 KB)

Its because you had a lens Ipo on the camera as well.

Select the camera, open up the ipo editor, change the ipo type from object to camera and delete the lens ipo.

Andrew, I know I have a lens IPO, but that’s not the problem. Did you try doing that on the file I sent? It doesn’t work for me. :no:

Ok, I checked it again and:

  1. Remove the lens ipo
  2. Remove the parent from the plane (alt+p > clear parent) then re-parent it to the camera.

Should work now.

You don’t have to remove the lens ipo if you want the camera to zoom past the plane, which it does once you re-parent the plane (instead of whizzing away).

Deleting the camera, making a new one and linking it to the old IPOs worked. Remade the lens IPO and its working fine now.

However, I want to try the scene overlay solution from Rorkimaru, but I don’t really understand how it works.
I made a new scene with the overlay. Then I linked the camera to this new scene, but it’s still moving, and I still need to parent the plane to the camera. Am I missing anything?

add a new scene
Add a camera on it
Add your 2D interface
In camera view, check if your interface is placed as you desire…
Then in the “main” scene add ( if you want that the overlay appears at game start:
Always Sensor (uncheck trigger buttons) -> AND - Scene Actuator - Add Overlay Scene - Name_of_the_scene_here

Thanks for your reply, Oto.
I already did what you said, but I’m afraid the camera has to be the same (linked) in both scenes. And since it has an IPO, it moves around in both scenes.

Why the camera should be linked?

If not, how do you tell Blender which camera it should use? I thought it used the one named Camera by default. Putting a new camera in the new scene doesn’t have any effect.

Let’s say you’ve a main game scene, with 20 cameras or whatever
Then you select a camera and do Ctrl-NumPAd0 to make it the “view/active” one
This one will be the “game view” if you press P key
If you add a camera in another scene/overlay scene it’s just to have a way of see/place your objects/texture/HUD to fit the “game window/view”
It’ll not interfere with the “active” one.
Do you need an example?

Now it’s perfect!! I didn’t know the Ctrl+NumPad0 command.
Thank you Oto :slight_smile:

Ther was nothing wrong with your first blend file it will hapen lots of times with diferent object i dont know why they dont do something about it because meual thing isnt good for few people (i needed lots of time to finde this out) you just press Ctrl+A and select “scale and rotation to object” this will aply it and all will be perfect (this works for all the same like soft bodys and so on)