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"

Unable to Create Widget, no outer provided

Hey,

I'm getting an error trying to grab a blueprint widget in c++ and spawn it. This is the error provided

alt text

My code is as follows:

alt text

And the blueprint is found in this folder

alt text

What is wrong with my code?

Product Version: UE 4.18
Tags:
error.png (21.0 kB)
error2.png (13.4 kB)
blueprint.png (27.9 kB)
more ▼

asked Feb 10 '18 at 04:23 AM in C++ Programming

avatar image

Cd1232
10 6 8 10

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

2 answers: sort voted first

I've got it working follow this advice found in https://forums.unrealengine.com/development-discussion/c-gameplay-programming/67719-cook-an-unreferenced-widget-blueprint

Here is my end code to get a UMG Widget Blueprint found and spawned using C++

alt text alt text alt text

more ▼

answered Feb 10 '18 at 05:08 AM

avatar image

Cd1232
10 6 8 10

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

Use the first line that you commented with FObjectFinder. Access you hud reference like this HUD.Object

more ▼

answered Feb 10 '18 at 04:37 AM

avatar image

Ali Akbar
681 2 5 8

avatar image Cd1232 Feb 10 '18 at 04:48 AM

And how do I go about using Create Widget with that? both MainHUD = CreateWidget(GetWorld(), HUD); and MainHUD = CreateWidget(GetWorld(), HUD.Object); result in compile failed with the reason being

alt text

error3.png (49.7 kB)
avatar image Cd1232 Feb 10 '18 at 04:55 AM

This also happens when using FObjectFinder

alt text

Doesn't matter if i use this static ConstructorHelpers::FObjectFinder HUD(TEXT("WidgetBlueprint'/Game/HUDs/MainUI_HUD.MainUI_HUD'")); or static ConstructorHelpers::FObjectFinder HUD(TEXT("/Game/HUDs/MainUI_HUD"));

(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