Cence
(MikeJasinski)
April 15, 2014, 6:31pm
1
Similar to how texture pointers are set up, would this code work to create a pointer to a blueprint? (In this case, “CrosshairTex” is a pointer to a UTexture2D.)
static ConstructorHelpers::FObjectFinder CrosshiarTexObj(TEXT(“/Game/Textures/Crosshair2”));
CrosshairTex = CrosshiarTexObj.Object;
I would imagine something like this would do it:
ConstructorHelpersFObjectFinder<UBlueprint> BlueprintObj(TEXT("Blueprint'/Game/Blueprints/SomeBlueprint.SomeBlueprint'");
UBlueprint* blueprint
if(BlueprintObj.Succeeded())
blueprint = BlueprintObj.Object
You can get the reference text to your blueprint by right clicking on the blueprint in the Content Browser and then clicking ‘Copy Reference’
Kochab
(Kochab)
May 25, 2014, 9:27am
3
You need a :: between ConstructorHelpers and FObjectFinder.
ConstructorHelpers::FObjectFinder<UBlueprint> BlueprintObj(TEXT("Blueprint'/Game/Path/SomeBlueprint.SomeBlueprint'"));
UBlueprint* blueprint;
if (BlueprintObj.Succeeded()) {
blueprint = BlueprintObj.Object;
}