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"

Line trace to change text on widget to an object name

I have been trying to make a widget change its text accordingly to what item hits the line trace. I am quite confused and cant seem to find any questions which help me. Help would be greatly appreciated. Thank you.alt text

Product Version: UE 4.18
Tags:
more ▼

asked Feb 18 '18 at 06:54 PM in Using UE4

avatar image

GoochWookie
1 1 2

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

1 answer: sort voted first

the issue here is that you dont have the anything connected to the cast node. with no exe pint the node will never fire. also with no reference plugged into the object node the cast will always fail.

to solve this take the exe pint from your trace and plug it into the cast node. then get a reference to the widget and plug that into the object pin.

more ▼

answered Feb 18 '18 at 07:31 PM

avatar image

ThompsonN13
10.1k 33 10 25

avatar image GoochWookie Feb 18 '18 at 07:53 PM

How would I reference the widget?

avatar image ThompsonN13 Feb 18 '18 at 09:59 PM

where do you create the widget?

basically go to where you create the widget and the blue return pin on it is a reference to the created widget. you can use that as a reference. i assume you create the widget in on your player character, player controller, or in the game mode. if thats the case you could take the reference and save it as a variable(ill assume its on the character for this example). then in your scanner bp do the following: get player character node -> cast to (insert player class here) -> get (insert variable name here).

alt text

alt text

capture.png (111.2 kB)
capture2.png (95.0 kB)
avatar image GoochWookie Feb 20 '18 at 12:36 PM

The widget is being created on another BP actor, so its basically like looking at a screen which displays the item name. I have followed your help and there is no errors now, thank you. It still isn't changing the text (or displaying it) on the widget. I will just have to attempt to mess around with it some more. Thank you for the help.

avatar image GoochWookie Feb 20 '18 at 02:09 PM

UPDATE: So if I add the widget to the viewport it updates the text, but the widget in the BP actor doesn't update, I am a little confused as to why.alt text

bp-actor-widget.png (506.9 kB)
add-to-vewport.png (130.7 kB)
avatar image ThompsonN13 Feb 20 '18 at 03:04 PM

the one on the actor and the one for the viewport are probably two separate objects so you will have to update them separately.

avatar image GoochWookie Feb 20 '18 at 03:48 PM

Sorry about the amount of questions, I am just wondering how I would update the actor, cant seem to think of a solution that works.

avatar image GoochWookie Feb 20 '18 at 04:32 PM

Doesn't matter I have it working now, thank you so much for your help.

(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