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"

Look at and show an image

Hi,

Please, can anyone tell me a way to make an image (widget) to show up in the corner when a character FP is looking up an object ?

Thanks,

Product Version: UE 4.21
Tags:
more ▼

asked Dec 11 '18 at 02:11 PM in Blueprint Scripting

avatar image

FernandoBrag
1 1 1

avatar image Tuerer Dec 11 '18 at 02:17 PM

First of all, let's make it clear what you mean by "looking up an object". Does it mean that the object is shown on the screen or is in the center of the screen (under the crosshair)?

Or "Looking up" means "searching for"? Please give a bit more detailed explanation.

avatar image FernandoBrag Dec 11 '18 at 04:18 PM

Thanks..I saw that video before but I thought it was a bit more complex no?

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

5 answers: sort voted first

eg: I have a box on a table so when I get close and look straight to the box and image or a text (widget) will pop up on my screen then when I looked away from the box the text will vanish..Does make sense now?

Thanks, :)

more ▼

answered Dec 11 '18 at 04:05 PM

avatar image

FernandoBrag
1 1 1

avatar image Tuerer Dec 11 '18 at 04:10 PM

Yep. Use Line Trace by Channel https://youtu.be/yo9VrxFgUJY

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Please, could direct me a tutorial where I can do the Line trace on a object and showing a widget image on screen. I have watched this one but its a bit different from what I am after ..

more ▼

answered Dec 12 '18 at 10:04 AM

avatar image

FernandoBrag
1 1 1

avatar image Tuerer Dec 12 '18 at 10:22 AM

Sure, I can show you some screenshots of how I would do that, but not right now, maybe in 6-7 hours.

I don't think there's an exact tutorial with traces and widget all-in-one. In a few words, you have to set a Line Trace, Break its Hit Results, and check if the Hit Actor is your Box or whatever. How exactly you check it may differ, I personally love Actor Tags, so I'd check if Actor Has Tag. If checking returns true, you get your widget and change the text in the corner to what you need (this text may be stored in the Box itself os that you can directly transfer it to the widget with no need to create additional text/string variables).

Here's a Break Hit Results screenshot I've found on the internert, just for reference. alt text

If you don't find a way to achieve your goal, I'll try to show you custom screenshots later.

image-45467.png (102.9 kB)
(comments are locked)
10|2000 characters needed characters left
Viewable by all users

Thank you Tuerer for you time!!....Well, that is when I get confused because I dont know how to connect the object ..etc.. I am not a programmer..so its quite difficult to me. I am not in rush..if you can show me a bit step by step I will be very grateful. Thanks

more ▼

answered Dec 12 '18 at 10:44 AM

avatar image

FernandoBrag
1 1 1

avatar image Tuerer Dec 12 '18 at 11:16 AM

I'm not a programmer either, that's why I'm using blueprints =)

Have you already created HUD and a Widget? Start with that. Just place any picture in the corner of your screen to be seen at all times. Finding a HUD tutotrial won't de a problem.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

well maybe I am far behind :).Thanks for your help anyway..:)

yes..I done :)..I have created a widget (called WidgetImage), then I clicked on the Open level blueprinted and done the this (image attached) and

its showing on the viewport ..:). when I press play

what should I do now?

alt text

capture.jpg (28.3 kB)
more ▼

answered Dec 12 '18 at 12:03 PM

avatar image

FernandoBrag
1 1 1

avatar image Tuerer Dec 12 '18 at 05:03 PM

Here it is.
You have already set the image. Good.
The tracing looks like this: alt text
I set a timer, but you can use Tick; I believe 10 times a second should be enough, hence time is 0.1.

Set Brush - is where you select your image. Make sure to right-click In Brush pin and Split it to see all of that.

I added the Set Visibility to turn a picture off when not facing the box, but you can do something else.

HUD and Widget and Image Box names will be different for you, of course, depending on how you named them. BTW, I save the HUD to a variable on Begin Play not to use Cast a lot. alt text

Well I guess that's it. Here's the result: alt text

Don't hesitate to ask if anything is unclear. But please, do that in comments, not in new answers.

boxx-trace.png (242.4 kB)
hud-ref.png (68.5 kB)
boxx.gif (2.4 MB)
avatar image Tuerer Dec 12 '18 at 05:36 PM

Oh, don't forget to add a tag to your box, if you'll be using Actor Has Tag.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

am I doing right..? is on the right direction ?

more ▼

answered Dec 12 '18 at 04:23 PM

avatar image

FernandoBrag
1 1 1

avatar image FernandoBrag Dec 12 '18 at 06:09 PM

Hey,.... wow..its perfect that what I want..!! I cant find anything on internet..looking for days..etc..

however, I was trying to do it but I get a bit lost i have started but I cant understand completed.. I will send scene where I was trying to do then please can you a look where I have stop...I've blueprinted on the fp character player..ok

link text

I just cant carry on from that :(.....

Thanks a lot,

avatar image Tuerer Dec 12 '18 at 06:14 PM

Sorry, but I won't download that. You can show your screenshots here and maybe someone will help you. It's not too hard, you just have to do some learning, and you can't do that if someone's doing your job for you.

avatar image FernandoBrag Dec 12 '18 at 08:29 PM

oh..sorry, I didnt want to come across like this.. I've send you a simple scene where I was doing the widget..your blueprint....etc.just for you to check what I have missed and instead of screen grab as there is a point that I really don't understand (its more about the languague as well) and .because you said you are doing in a different way using actor tag so I thought it will be hard to find somewhere to learn as I've have been looking for this for long time with different tutorials However,no one shows like you have done....I thought looking on the a scene it will be better to figure out and apply to my real scene project..

Anyway,I think I am going to have a look deeper and with calm ...about
tags etc..and I might post a screen grab ask you a question in the future.. :)..Thanks

avatar image FernandoBrag Dec 17 '18 at 02:01 PM

alt text Hi Tuere, I am came up this weekend with this blueprint..its a bit different, but between you stuff and other things I've learned..etc.. but the only thing that is missing is when the camera its not looking the box and makes the widget go away...Right now I have by time showing on the viewport, and its not that great... Any idea ?

Thanks, Fernando

captureue4.jpg (83.4 kB)
avatar image Tuerer Dec 17 '18 at 02:23 PM

The Line Trace node has a Return Value output pin that shows if there's a hit. Add a branch right after the Trace with that Return Value, and if it's false, make your picture invisible or remove it.

And next you want to check if the hit object is your box (or another object that should be displayed in a picture), and if not, make a picture disappear as well.

Another thing: I'd suggest adding the widget to the viewport once (on Begin Play, for example), and then just change the picture in it, so you won't have to create and destoy it every time.

avatar image FernandoBrag Dec 19 '18 at 11:11 PM

Thanks, (sorry just was having time today to have a look) I was trying but it's not working ..I am not sure why ?? Please, can you see what is wrong? alt text

capture.jpg (49.3 kB)
(comments are locked)
10|2000 characters needed characters left
Viewable by all users
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