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"

UGameplayStatics::OpenLevel - UUserWidget Problem

So I have custom UUserWidgets that I instantiate from BP code. My C++ has singletons for those UUserWidgets that it assigns through BeginPlay and unassigns through BeginDestroy.

Now the problem is that when I call UGameplayStatistics::OpenLevel - the widgets are destroyed but BeginDestroy is never called. So even if I were to create the widgets for each level ( seems like a bad solution ) - the C++ code would throw an error for widgets that it already constructed.

So I have a few questions:

1) Is it possible to make UUserWidgets persistent between levels? 2) Is it possible to make BeginDestroy trigger, and if not is there another function I can use to detect the widget being deleted?

Product Version: UE 4.15
Tags:
more ▼

asked May 03 '18 at 12:48 AM in C++ Programming

avatar image

Sir Rogers
6 2 4 8

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

1 answer: sort voted first

Answering my own questions.

Sion Sheevok, a member of the Fortnite UI Dev team was kind enough to help me find the solution to this on Discord.

The function to detect the widget being taken off the viewport is NativeDestruct. That's what I was looking for!

more ▼

answered May 11 '18 at 12:52 AM

avatar image

Sir Rogers
6 2 4 8

(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