Hud Messages

Hi guys i want to make it so that when i try to open a locked door (i already have a door blueprint with lock) a message appears on the players screen saying that the door is locked for a few seconds how do i link up my door blueprint to my hud blueprint?

You shouldn’t need to link up your door blueprint to your hud blueprint just print a message on the screen, just use the print string node in the door blueprint and it will print whatever you want it to say.

So for instance, in your door BP, you create a variable called ‘IsLocked’ of type ‘Bool’, and you set it to ‘True’. Then when you try to open the door you just check the ‘IsLocked’ variable, and if it is ‘True’ you print the message that it is locked and if it is ‘False’ you jump to the code to open/close the door.

Thanks man :slight_smile: just wondering is there a way to get the message to the center of the screen and is it possible to control things like size and length of time that it is displayed on the screen

Print scene doesn’t work when you package your game, its used for debugging. To do what you want you’ll need the HUD blueprint. You can use the “Draw Text” node for it which will allow you to position the text. As for communicating from the door bp to the hud you should look into “Blueprint Interfaces” and “Cast To”. BPI’s are used for triggering events in other blueprints and cast to is used for getting and setting variables in other blueprints.

Thanks man you have been really helpful :slight_smile:

NVM, I was going to correct my answer but Pattym has it covered