From my ProjectilePak.h:
UPROPERTY(EditDefaultsOnly, Category = Projectile)
TSubclassOf<class AFPWeaponsTestProjectile> ProjectileClass; //Projectile class to spawn
I am trying to assign the above as my blueprint projectile using ConstructorHelpers in my Magazine class constructor so that I can spawn a projectile on firing a weapon.
I have tried using both FObjectFinder & FClassFinder but neither seem to work, and I am unsure of what I am doing wrong.
Here is from my Magazine.cpp constructor:
static ConstructorHelpers::FClassFinder<AFPWeaponsTestProjectile>
ProjectileBP(TEXT("Blueprint'/Game/Weapons/Projectiles/FirstPersonProjectile.FirstPersonProjectile'"));
ProjectileClass = ProjectileBP.Class;
Note: This compiles but the ProjectileClass is NULL & as such never spawns. I have also modified this to use FObjectFinder as well as changed the type in the <>.