Adding Text/Password To World Through Trigger

Hello, I am a beginner in using Unreal Engine 4. I have been practicing UE4 for almost a week now and as one of my first projects I am attempting to complete, I am trying to make a “Physical Password” appear as text in my world.

I want to set up Trigger volumes at each of the letters to arrange the “Password” on the wall as I “write” it by pressing my use key on the letters. After which if the letters are arranged on the wall in the correct way, the password is accepted and triggers another event, such as closing the project. On the other hand, if the password is incorrect, it resets.

All tutorials I have seen are using the HUD as where the text appears, and this I do not want. I do not want to use the mouse on a keypad or my camera’s crosshair as a selector. Again, I am new to this, but I have been having a blast learning how to use it, and the blueprints make things so easy and user-friendly. I do not know a lick of code, and what I have achieved in my project has blew me away already. I would appreciate any kind of help with this issue I am having of just not knowing the first step to take to make what I want possible in this situation and am unable to locate any tutorial explaining exactly what I’m trying to do. Thank you. :slight_smile:

If you need more information, please let me know.

In order to create the diegetic text (diegetic means that it belongs in the “real” game/media world, not a representation that only the player/spectator can see - like a HUD) you should use a Text Render actor (or component):

With this in the scene, you can easily change the text by using the Set Text node (in this case, the text changes when you enter the trigger):

I hope that guides you on new directions.
I`m happy to hear that you are having a blast with Unreal. It only gets better. :slight_smile:

Super happy to see some help to my question. :slight_smile:

However (I haven’t attempted it yet but…) from what it looks like, that was the easy part. Any chance you have any clue how I could make it work like a in game keypad would with passwords? Remembering, placing the letters in the “keypad on the wall”, and detecting the correct string of letters to trigger an event of my choosing, or otherwise detecting the incorrect string of letters and resetting? That’s the part that intimidates me the most. :frowning:

If it helps, here’s my project. (I think I exported the correct folders for moving.)

https://drive.google.com/open?id=0Bw4XNvtP_BgRSDRrQVRHRmRkOTQ

Again, this is pretty much just me learning how to use the engine. It’s not very pretty. Walk into the wall to bring it down.

EDIT: Am I over-thinking this, and could I make a widget like you normally would with a keypad, except have it spread about instead in a single location like they normally are? Is that possible?

Well, you could create a widget and place it in 3D space to create the effect you are looking for. But honestly, I don`t think this is the best approach.

Making the password system should be just as easy as the text:

When each letter is interacted with by the player (by pressing the use key on the letters), you want to add a new character to a string “Typed Password” or something:

This way, the player is writing the password on that variable.

All you need to do now, is to test if the string is the correct password when its length is correct. If its the password, you can do whatever you want, else, you can reset the players typed string:

Cheers. :wink:

This looks fantastic. I went ahead and attempted to plug it all in together with the text renderer from your help on the first post. This is what I ended up with trying to combine them but I am not sure where I plug a couple things into. Also, I decided to not apply it to a button press, instead just overlap.

As you see I already have one plugged in, but I’m not so sure it’s connected to the correct thing. The other is just where do I put the Correct Password Set in order for it to be recognized as the correct string of letters.

So far I have managed to get the triggers to fire. However the letters do not add to a string with my current blueprint set up.

I am sorry for my newbie-ness and wish I wasn’t being such a pain, but I would really appreciate it if you could help me with this? I’m sorry if it’s painfully obvious where these things are suppose to go, perhaps I am just blind.

No problem!

You should set the ‘Correct Passoword’ by clicking the variables and changing the default value on the right (no need to set it in the blueprint).

As for the Set Typed password, it is necessary to have one version of the Set node for each trigger, because it trigger is going to add a different letter to the variable. (And I believe you are appending the Correct password, where you should append the Typed Password instead)

This is the basic idea:

  • Typed password variable is set to nothing “”
  • Correct Password variable is set to the correct password (in the default options)
  • When you overlap with the BlackBox_E_Trigger, you set the text, set the Typed Password variable to Typed Password + “E”. (Now typed password is “E”). Then it would do the length branch and fail.
  • Let`s say the player overlaps with the A trigger now. You set the text, set the Typed Password variable to Typed Password + “A”. (Now typed password is “EA”). Then it would do the length branch and fail.
  • And so on.

This image shows how the Set Typed Password needs to have a different value for each trigger (since the branch doesn`t, you can connect all the sets to them).

If you want the player to try again after failing, you have to set the Typed Password to nothing “” (resetting its value).

Let me know if it works for you. :wink:

Yes! Awesome! I am able to watch the nodes get triggered correctly when I over lap the password triggers in the correct order, to the correct end result. aka. it works. Likewise the code fails when input the incorrect way! Perfect!

There’s only one thing that doesn’t still work, but it’s not a required functionality, it’s just what I would like for it to do visually. The important part is that it triggers correctly, which I am super happy about. Thank you so much!! This was the most complicated thing I’ve done in blueprint (Except for following a tutorial video on making animations/animation BP’s.) almost on my own (With huge help to you! Thank you!)

If you’re still feeling generous however, the problem that still persists is as in my previous #1 & #2 labeled photos. When I activate a trigger, it doesn’t add the letters to the string, instead it just replaces. I mean, to the world text renderer. I guess in the blueprint it’s adding it, but it’s not showing the update in real time.

Like I said, the functionality works and thats the most important part!
Thank you so much. :smiley:

EDIT: Actually, my 68 year old father who has never touched or seen unreal engine a day in his life offered a very likely fix to my problem, by making seperate text renderer’s in my world for each letter… Unbelieveable. Why didn’t I think of that? That could probably be easily implimented. Anyway! Thank you for your help again. :slight_smile: