How to get UStruct* reference from a USTRUCT object

I’m trying to construct a FStructOnScope and it’s constructor looks like this

FStructOnScope(const UStruct* InScriptStruct)

I have a structure named Config in my class that I need to pass to this

Trying this FStructOnScope(&Config) gives an error

 'FStructOnScope::FStructOnScope(const FStructOnScope &)': cannot convert argument 1 from 'FDungeonConfig *' to 'const UStruct *'

If anyone’s interested, here’s how you do it:

	TSharedRef<FStructOnScope> ConfigStructRef = MakeShared<FStructOnScope>(FDungeonLevelStreamingConfig::StaticStruct(), (uint8*)StreamingConfig);
	ConfigCategory.AddAllExternalStructureProperties(ConfigStructRef);
1 Like