Download

Draw Text - Multiple Box Triggers each with Different Messages?

Hi Guys,

So I was following Tesla’s tutorial on YT regarding drawing text to the HUD and I was wondering how I could do this with multiple box triggers each with their own individual messages?

It’s probably a really, really dead simple answer I just don’t know what it is. In my case I have doors in my level, one which animates and is ‘stuck’ and displays the error message I defined on the user’s HUD. I want to display another message on-screen when the player enters my other box triggers I have placed in my level.

My setup atm:

HUD BP: 8f09dc61614f9f03381976f574304292d202f18f.png
DoorMessage: cfd3fe43dcd58b9ded705f02e9ddd99df1d446f4.png
Level Blueprint:

Thanks

Bump, could really need some help with this!

Hi
better use umg ,

Create a WidgetBp , inside of it create a TextBlock (in my exemple i named it MyTextBlock)
and after you add it to viewport you can change it text as you want

c99aded8510811112b38c5a9aaa1f7f1bd7bff47.png
28cd0134b0e578ae74db947d308a4f4b1df48435.png

Hello,
Maybe can you create an array of texts and use the index as reference with an int variable in your triggers. 0 : need a key 1 : door is stuck 2 : you need a code too and others. You set the initial value in event begin play in level blueprint and set it to new value each time an event make status change ?

Hi guys,

First of all thanks for the replies. Like I said, I’m a bit of a noob when it comes to blueprint so I’m not quite sure how to use arrays. I’ve seen other videos of people using them but I’m not sure how I’d go about setting one up for mine. Any starters on node placement and what to hook up and where?

Cheers!

Give you one example in a second how it could work. Give me 5 mins

Get Character Reference - Example your door which has your trigger box, made one for a mesh in my game. Trigger Box is called Sphere 1

In MyHud

On Begin Play, get BP Reference.

1a3195017b6f933c4dcbfac487c6c83f3a33153a.jpeg

“Get” Trigger Box, Then set on overlap collision and then send to a “Draw Text” node.

8fdf268f13203ebee143d4d7c3d4c2f89cd21d93.jpeg

Hud X and Hud Y are variable I get from the original MyHud for the crosshair and replaced them so I could edit them.

7ea6422903a1c05015a4328deea9057ecbe65911.jpeg

Hopefully that works.

Narg