How do I make a text box pop up if character is close

I want to make a text box that will pop up when my character is close.

You can use a proximity behavior to detect when the player is near it.
Then you can hook that up to an alert behavior.

What he said lol. Use a nor gate to test if the player is not near.

Also @grazer when you hide a text block it activates whatever is attached to click.

By the way, welcome to the forums @KishoreN!

I know about alerts. But I don’t like how alerts get in the way of the screen. I want a tutorial because I find my friends mess up without knowing the controls.

1 Like

I want to use a text block. Also thx for the quick reply.

Well you can do it in multiple ways, with labels or with some of the text behaviors.
What really matters is how it would fit in your game, or how you want to display the text.
When you say “text block” do you mean like a separate UI box with text in it?
Before you actually add any of the stuff in you should think about what it’s going to look, act, and interact with the game itself.
Basically how do you want to show the text to the player?

1 Like

Yes I want to display text when my character is close.

Could you link the game so I can get a better understanding of what you mean?
I know that you want to have the text show up when the player is close but how will you show it?
Do you want a pop up? If so Where?
Do you want a designated text box? Where would that be? How would it work?
Do you want a speech bubble? Where will it show up?
That’s the kind of thing I want to know since I can’t really help you place bricks to build a house with no foundation.

1 Like

Ok yeah I get it.

This is kinda how I want it.
Screenshot 2021-02-17 at 2.32.58 PM

So I took a look and there’s really not much to work with, maybe you can make a dummy obstacle course with a few floating platforms for the player to learn the basic controls inside the tutorial level.

I’m going to guess you want some kind of sign system because you said you wanted the text to show when the player got close.

Basically you should create a sign object and put a proximity behavior to detect where the player is.
When the player gets close the proximity behavior can be connected to a switch behavior, in the On and In nodes.
Then just some basic label behaviors hooked in to the switch.

The last thing you would need to do is detect when he player is not in the proximity.

A logic gate set to XOR should be connected to the Off node in the switch behavior.
Also don’t forget that the Proximity behavior should also connected to the logic gate in the A or B node but not both.

(btw the behavior you have in your screen shot are text behaviors, they don’t show any visible text to the player, it’s mainly use to store text data but that isn’t relevant)

If all of that went over your head I can put a screen shot of all the behaviors.

1 Like

Lol screenshot please.

So I missed a few steps, woops.
sorry I couldn’t respond sooner, while I was making the example my mouse disconnected around 20 times and I had to restart my computer for each time, not relevant but whatever.
I think this should work, although it doesn’t for me. The logic should make sense, I don’t know if this is a bug or if I’m just dumb. you can try it out, maybe it’ll work for you.


Thx it works! This is how I wanted it.

1 Like