I have a main scene, where i have my character, rooms... Then I have a scene for healthbar, inventory and all that stuff. And I don't know how to interact between those two scenes. For example: When some sensor is triggered in the main scene, how do I link that with the GUI scene to show some information text or something else?

I know this is probably a very easy question and I should know things like that, but I'm not very experienced with blender game engine, and also I couldn't find zhe answer on the internet.

Thank you for your answers.

  • $\begingroup$ So, essentially you're trying to put a scene with your HUD onto your scene with gameplay? $\endgroup$ – Scalia Jun 17 '15 at 16:42
  • $\begingroup$ It's not an easy question. Nobody knows how to. Trust me, you can't even make it alternate between layers (although you can store an object in another layer, if you want to clone an object projectile.) $\endgroup$ – Nefer007 Jun 17 '15 at 17:03
  • $\begingroup$ @Nefer007 I wouldn't go so far as to say that... I was just clarifying as to what he was asking $\endgroup$ – Scalia Jun 17 '15 at 17:13
  • $\begingroup$ like, add overlay scene?, or, have an event in the main scene trigger something in the HUD? $\endgroup$ – X-27 wants to Reinstate Monica Jun 17 '15 at 17:33
  • $\begingroup$ yes. like if you would to pick up health and healthbar would increse. $\endgroup$ – Roki Podpecan Jun 17 '15 at 17:39

In the BGE, some methods can be used to interact whileas others can't. My personal favorite way to interact between scenes is by using messages. I have provided steps and an example on how to create what you are asking for. Considering that I have this ("When some sensor is triggered in the main scene, how do I link that with the GUI scene to show some information text or something else?") as my information to work with, I was not sure of what exactly you wanted.


(Now knowing exactly what you want, I am not sure if this is your exact situation)

1) With your camera, have an always sensor and a scene actuator to display your HUD:


2) In your hud, select your object that need to be visible and invisible when triggered, and create the following logic:


(This says that when the prop "Show" is true, the object is visible. The object is invisible when the prop is false. When a message "Show" is recieved, it will make the prop True. When a message "DontShow" is recieved, it will make the prop False.)

3) To send the message "Show", select your trigger object and add your logic but make sure the actuator send the message:


4) To make the object that gets triggered invisible, we need an object that sens a message "DontShow":



I am sorry if I was difficult to understand in any of this, and I don't know if I was, so I've created an example .blend which can be found here. For the .blend file, when you collide with the pink object, a green sphere appears in the HUD. When you press Spacebar, it disappears. Hope this helped!

| improve this answer | |
  • $\begingroup$ I've read the comments, and it seems that you want to add health in the HUD. You can send a message saying "Add", and the object that receives it adds health points to the property for your health once received. $\endgroup$ – blackhole Jun 18 '15 at 5:36
  • $\begingroup$ Thanks a lot. I also checked the blender manual (blender.org/manual/game_engine/logic/actuators/message.html) and there it says that the alternative to the message actuator would be bge.logic.globalDict, which i know is used for saving game progress, but I don't know how it could be used for comunicating across scenes. $\endgroup$ – Roki Podpecan Jun 18 '15 at 16:39
  • $\begingroup$ I was looking on YouTube for a tutorial about editing text objects in bge, and I foud this video: youtube.com/watch?v=s55R9mIPE1k So that's how you comunicate across scenes using python controller. $\endgroup$ – Roki Podpecan Jun 18 '15 at 18:17

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.