Hello,
I am stuck with a little problem.
I have a vehicle definition asset with this reference (copy reference in content browser): Blueprint’/Game/VehicleAdvCPP/VehicleDef.VehicleDef’
which is derived from a Blueprintable c++ Class UVehicleDefinition.
UCLASS(BlueprintType, Blueprintable)
class TANKGAME_API UVehicleDefinition : public UDataAsset
{
}
Reading through the forums it looks like I have to load this object into a UBlueprint class, however I would like to get a pointer to UVehicleDefinition.
Here is the code I use to find the object
ConstructorHelpers::FObjectFinder<UBlueprint> CHFVehicleDefinition(TEXT("Blueprint'/Game/VehicleAdvCPP/VehicleDef.VehicleDef'"));
UVehicleDefinition* PVehicleDefinition = CHFVehicleDefinition.Object;
Why does this not work? What is the right way to load a Blueprint derived from C++ and retrieve a C++ pointer?
ConstructorHelpers::FObjectFinder<UVehicleDefinition> CHFVehicleDefinition(TEXT("Vehicle'/Game/VehicleAdvCPP/VehicleDef.VehicleDef'"));
UVehicleDefinition* PVehicleDefinition = CHFVehicleDefinition.Object;
The example in the mid seems to find the object, the second one doesn’t.
Is there any C++ tutorial or documentation about loading assets with asset references?
Thank you in advance