x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

Adding text popups when interacting with objects

Hi, total newbie here, I am making an exploration game and the concept is that my character wakes up in a strange land , there will be a boat next to my character , I want the text to popup when my character goes near it and then disappear when she goes away. I checked online tutorials but all shows either to use the mouse interaction popups and text that appear when the game starts .Please tell me a solution for this .

Thanks

Product Version: Not Selected
Tags:
more ▼

asked Apr 28 '18 at 07:08 PM in Blueprint Scripting

avatar image

Kiran_I
1 1 2 1

(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

Use a "box trigger" around the boat and make it as large as you would like the player to be able to interact with it. Then in your level blueprint, create the widget that has the pop up text you desire, add it to the viewport and then hide it. Create an overlap event for the box trigger in your level blueprint that goes something like this:

  1. on overlap --> cast to player --> successful? then set widget visibility to "visible"

  2. on end overlap --> cast to player --> successful? then set widget visibility to "hidden"

more ▼

answered Apr 28 '18 at 07:15 PM

avatar image

Nebula Games Inc
4.6k 27 9 14

avatar image Norishou Apr 28 '18 at 08:19 PM

So like this. alt text

avatar image Nebula Games Inc Apr 28 '18 at 08:52 PM

Yea except personally I don't like "creating" and "removing" widgets. I find it inefficient for something this simple. I prefer to actually create the widget in the level or character depending on it's eventual use and then simply toggle it's visibility. It lets you be more versatile with the text as well you can use it for other things and change the text, I've used widgets like this as a pop up HUD for a computer AI that talks to the player and then repurpose it to be a pop up for an interactable object without needing to "create" 2 separate widgets. But that's my personal preference.

avatar image Kiran_I Apr 29 '18 at 05:02 PM

Thank you very much , I will try this out and let you know if I run into any errors !

avatar image Kiran_I May 03 '18 at 04:18 PM

hey I am a total newbie and I have no idea how you got the set widget part in the blueprint , I have created the box trigger for the boat and added the above blueprint functions you've shown except for the set widget and get widget part . i've created a widget blueprint with the desired text but i dont know how to proceed after that , im sorry for the trouble but I cannot find any tutorial to help me with this .

avatar image Nebula Games Inc May 03 '18 at 04:24 PM

Haha no problem. Right click on the output pin after you create the widget and promote it to a variable. That set widget is a custom variable. Then you can use that for the get widget node

avatar image Kiran_I May 03 '18 at 05:51 PM

Hi , Okay so here is what i've done so far , I know this is very simple and you must be going like oh gosh this kid. so for easier explaining i'm putting some screenshots of what i've done.! as you can see ive created a widget blueprint and i have created a new HUD class and then in that HUD class i've created the widget and added it to the viewport. after doing that i've followed your steps in the level blueprint but I don't know how to get the missing nodes in that . the New HUD class is visible when I play the game tho.

[1]: /storage/temp/239785-lb.png

hud.png (101.5 kB)
hud-display.png (1.2 MB)
lb.png (114.0 kB)
avatar image Nebula Games Inc May 03 '18 at 07:54 PM

So this isn't a tutorial for your specific case BUT it was the only way I could think of to show you how to do it since telling you "right click on the output pin" didn't work. Skip to 2:00 and I show you how to make the variable thing. Once you have the variable created you can "drag" it from the left side panel of variables and say "get" to create the "get widget" node. Hope that clears things up for you!

https://youtu.be/95CMPGQAS-Y

avatar image Kiran_I May 03 '18 at 10:07 PM

I understood when you said right click on the output and promote to variable , the problem I was running to was different , thats why I sent the screen shot. the node pins I've marked in red in this screen shotalt text aren't getting connected . thats the issue I'm running into

not-connecting.png (124.6 kB)
avatar image Nebula Games Inc May 03 '18 at 10:57 PM

Ahh, well you haven't actually "created" any widget. Look at the "CONSTRUCT" event, it says "none" because you haven't selected a widget, so the variable isn't holding anything so you can't connect it up to anything because it has no data

avatar image Kiran_I May 05 '18 at 12:03 AM

Thanks for the help man . I found a tutorial finally on how to do something similar , ill post the link here , its very similar to what you said but a bit different.

[1]: http://www.youtube.com/watch?v=UsFsTFIA72Q

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question