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"

Office Holiday

Epic Games' offices will be on holiday from June 22nd to July 7th. During this period support will be limited. Our offices will reopen on Monday, July 8th. 

Triggerbox and HUD helptext

I made this Triggerbox with OnOverlapBegin and OnOverlapend functions, so im planning to do is make a string variable, and when;

OnOverlapBegin function is used, the string variable will be assigned a value of "Press C to crouch" (for example) and

when Overlapend function is used, the string value will be set to none.

so in the UserWidget HUD, named PlayerHUD, i would like to get the string value of the Triggerbox and assign it to a textbox.

Product Version: UE 4.18
Tags:
more ▼

asked Feb 12 '18 at 08:05 AM in C++ Programming

avatar image

stevenfrost
6 2 4 6

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

2 answers: sort voted first

Your best approach to this is in the function you have bound to the OnOverlapBegin,

 TriggerBox->OnComponentBeginOverlap.AddDynamic(this, &AClass::OverlapBegin);

you will want to get the HUD,

 AMyHUD * hud = Cast<AMyHUD>(UGameplayStatics::GetPlayerController(this, 0)->GetHUD());

and then set the your text box value on the HUD to be 'Press C to crouch'. Then so the same but OnOverlapEnd event.

more ▼

answered Feb 12 '18 at 10:33 AM

avatar image

Dune
1.9k 52 40 200

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

wait so where do i put

 TriggerBox->OnComponentBeginOverlap.AddDynamic(this, &AClass::OverlapBegin);
 AMyHUD * hud = Cast<AMyHUD>(UGameplayStatics::GetPlayerController(this, 0)->GetHUD());
  ?

and the MyHUD should i change it to my PlayerHUD? making it

  APlayerHUD * hud = Cast<APlayerHUD>(UGameplayStatics::GetPlayerController(this, 0)->GetHUD()); ?
   
more ▼

answered Feb 12 '18 at 12:19 PM

avatar image

stevenfrost
6 2 4 6

(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