Unable to create a 'World Soft Object Reference' Variable in a struct

Related to UE-60933 (Unreal Engine Issues and Bug Tracker (UE-60933))

It is possible to get around this issue in some cases by creating a node that uses a WorldSoftObjectReference, and then pulling from it and promoting it to a variable.

HOWEVER, this workaround obviously won’t apply to BP structs, so you cannot store WorldSoftObjectReferences in structs (making it hard to mark up map references with metadata for instance).

Is this functionality intended? It doesn’t seem like it would be since the variable type doesn’t show up in the variable type list but is totally possible to create (in the context of a Blueprint) by promoting a pin to a variable.

Epic really half ■■■■■ Blueprints, didn’t they? :frowning:

I ran into this problem too.

For me, the solution was to create my own struct in C++. This of course takes a little bit of learning to get started, but it’s quite basic. You can then just use these in your Blueprints, as if you created it through the editor. It won’t be located in your Content Drawer though.

Here’s what my .h file looks like:

#pragma once

#include "CoreMinimal.h"
#include "Engine/DataAsset.h"
#include "SequenceLevelStruct.generated.h"

USTRUCT(BlueprintType)
struct FSequenceLevelStruct
{
	GENERATED_USTRUCT_BODY()

	UPROPERTY(EditAnywhere, BlueprintReadWrite)
		TSoftObjectPtr<UWorld> Level;
	UPROPERTY(EditAnywhere, BlueprintReadWrite)
		bool otherVariableOne;
	UPROPERTY(EditAnywhere, BlueprintReadWrite)
		bool otherVariableTwo;
};
1 Like

Its 2023 and I can confirm this is still an issue.

You cannot add World Soft Object reference to a struct without C++

1 Like

jep, only way i found was to create a load stream level node (or any node) which takes a level as an input, right click the in port and promote variable.


you can then go ahead and convert it to array:
image
and cycle through your selected lavels via an index for example:

1 Like

The engine does allow you to create World soft object variables by default, it’s just wrapped in a struct:

2 Likes

Where exactly did you find this? I’ve done searches through variable types in several different types of blueprints but wasn’t able to find this variable in any of them.

Newbie here. I just wanted to clarify for the other newbies:
If you’re trying to use Interfaces to set a variable containing a level, try this:
You’re looking for a “Soft World Reference.”
It’ll be deep blue even though the pin that you might be working with is light blue.
That’s ok for now.
If it’s deep blue and you need it to be light blue, right click the pin inside the node and click “Split Struct Pin.”
That should fix the compatibility issue with the pins so you can more easily control the variable.