Accessing Blueprint properties wihout spawning

Hi,

If I want to read properties of an object that are declared in a C++ class, but set in Blueprint, is there a way to do it without spawning ? In Unrealscript, defaultproperties could be accessed statically, I wonder os such a thing exists in UE4.

Like if you want a weapon choice menu, you need to display the weapon’s properties, but actually spawning the weapon could be an issue.

Thanks !

Yeah, you can use the same general method as UE3. Here’s some example code using the DefaultPawnClass that’s defined in GameMode:

UPROPERTY(EditAnywhere, noclear, BlueprintReadWrite, Category=GameMode)
TSubclassOf<class APawn>  DefaultPawnClass;

APawn* DefaultPawn = DefaultPawnClass->GetDefaultObject<APawn>();

This is a bit unsafe (you could modify the object at this point and cause issues) so it’s not exposed to blueprints, but you can do it from C++ as needed.