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"

TRIGGER BOX AND USERWIDGET HELP :(

I tried a bunch of stuff to try and manipulate the Text Block of a User Widget, some of them were close and ended up a failure, ive hit so many dead ends and the deadlines getting near, i need help :(

so i have this Trigger Box that has an FString named Help Text, and On Overlap Begin the variable will have a value ex.)

    OnOverlapBegin()
   {
     HelpText = "Press C to Crouch ";
 }

and

    OnOverlapEnd()
   {
    HelpText = "";
    }

and on the UserWidget i binded GetText_0 to my TextBlock and the bp of GetText_0 is

alt text

soo ummm im having problem with referencing the Cast to MyTriggerBox1

people said that i need to cast something, but i am new to ue4 and i dont have any clue where and what to cast. /// What im trying to do is Manipulate the Textblock on my UserWidget named "PlayerHUD", using The TriggerBox, named "MyTriggerBox1". so if there is a more efficient or easier way or if my way will not work plss tell me.

Product Version: UE 4.18
Tags:
capture.png (106.7 kB)
more ▼

asked Feb 13 '18 at 05:42 PM in C++ Programming

avatar image

stevenfrost
6 1 3 6

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

2 answers: sort voted first

Follow this image: Get Player Character (note the 0 in the index. This may not work in multiplayer games.)

From the player character, you will get the hitbox, or the interacting item, which holds the hitbox.

As a general rule, when you cast something, you need to get an object to cast it into. Here is how to do it in C++:

https://answers.unrealengine.com/questions/340108/cast-to-first-person-character-c.html

alt text

more ▼

answered Feb 14 '18 at 01:28 AM

avatar image

Aericks
95 6 7 17

avatar image stevenfrost Feb 14 '18 at 02:12 PM

Heyy uhh sorry for late reply, and thanks i would try this out! Ill let you know if i encountered a.problem

avatar image stevenfrost Feb 15 '18 at 12:22 AM

so lets see, im going to cast my main character to the triggerbox(c++), that will interact to my triggerbox,

after casting it, i can reference my character to the bp and then i can get the triggerbox?

then gets the value of a variable inside the triggerbox and use it to bind the textblock? am i understanding it right?

so bp could be like this ? :

get player char -> cast to MainChar -> cast to TriggerBox-> get helptext -> Return node

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

You will either need to use the BeginOverlap event in the trigger box, then get your widget from there (Not sure where you widget is kept currently?). Or, in your widget, get the trigger box (Not sure where you trigger box is either?), and then hook up to the event:

alt text

capture.png (102.1 kB)
more ▼

answered Feb 15 '18 at 09:29 AM

avatar image

Dune
1.8k 52 36 197

avatar image stevenfrost Feb 15 '18 at 09:40 AM

I did it earlier, i ended up, making a function in my character to update the text block, and then casted it to my trigger box to update the text block when onoverlapbegin and end. Anyways thanks for aswering!

(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