Creating a Speech Bubble that the Player can type into in game

Hello all! I’m currently working on a project that has the player type sentences in game, like Elegy for a Dead World. However, I wanted to have the writing prompts appear above the player in a speech bubble. I’m going to list below what all I think I need to make this blueprint work and what all I have tried so far. As a quick heads up, when I started this project I was doing it in 4.12 and now it has changed to 4.16. Any help would be greatly appreciated and I will try to respond as soon as I am able. Thank you.

Things needed to make this work:

  • An interactive object / area that prompts the player to write.
  • The ability to place multiple versions of this blueprint in throughout the level.
  • The blueprint needs to allow for the player to type using a keyboard.
  • A speech bubble that appears over the player character.
  • The speech bubble needs to be able to change shape depending on the amount of characters typed.
  • The typed text needs to have word wrap implemented.
  • Upon completion the object / area can no longer be interacted with.
  • Upon the completion and entering of the text, it needs to be stored for later use.
  • The entered text can be recalled and appear in the order that the player entered to prompts.
  • The recalled text is displayed as a series of journal-like entries.

Things that I’ve tried:

  • I tried following along in this video “Player can type in stuff onto the HUD” and got it to work. But I couldn’t figure out how to incorporate the text into a speech bubble and creating a keyboard event for every key caused problems in game when I needed to press other keys for other mechanics.
  • Using that same basis for the typing, I decided to see how far I could get with making a trigger box initiate the typing blueprint. I got the blueprint to work when the player entered the trigger box, but if I had more than one typing blueprint in the level it caused some of them to just not work entirely.
  • I changed it so that all trigger boxes were located in one blueprint and just moved them around in the level to hopefully solve the problem of blueprints interfering with one another and this worked. However the way it is setup the blueprint only stores one entry and deletes the rest.
  • I tried to figure out how to get arrays to store the text entries but it’s a bit beyond me at the moment.
  • I’ve look into the Blueprint Example Project as a potential solution for the speech bubble to change size based on text.
  • I’ve looked into 3D widgets, although I am not that experienced when it comes to UMG.
  • You will want to make this in a Widget.
  • Use the WidgetComponent in your blueprint to place it in the world
  • To make it look like when you type that there is suggested text, I suggest you layer two Text Boxes over each other, the one in front to have them type in, the one in back, to have the same starting text plus the next suggested word appended at the end. Also make the text in back a different color, like a lighter gray. Whenever the text in the typing box updates, update the backing text.
  • The algorithms for text prediction / interpretation are up to you.

Thanks for the reply! I ended up spending a good while looking into widgets and got the bare bones of this mechanic working. I’m thinking once I get some free time I will do a write up explaining how I got it to work and what steps need to be taken to replicate it. Just in case someone else wanted to do something similar.

The only things I haven’t gotten to yet is the text being recalled and then used in a journal. But I’m hopeful that I will get it done this weekend!

By “text being recalled”, do you mean being saved for later use? You can access the text property of the TextBox then store it in an array or something.

Also if my answer helped you with your solution, could you up-vote/mark as answer?

When you do have a finished solution you should add it as a Community Tutorial, and then link to it in your question