I have a projectile manager and my first latent node is responsible for spawning a single projectile. I then want a second one that can spawn a number of projectiles, but it doesn’t seam to work. It won’t appear in the editor if it’s flagged as BlueprintInternalUseOnly since it doesn’t want to act as though it’s latent. This is just utilizing UBlueprintAsyncActionBase I’m not using latent actions code.
Spawn Projectile
UFUNCTION( BlueprintCallable, meta = ( BlueprintInternalUseOnly = "true", WorldContext = "WorldContextObject", AutoCreateRefTerm = "IgnoreActors", Speed = "1000.f", HomingRadius = "600.f", ChainsRadius = "600.f", GravityStart = "0.5f", RotationStart = "0.5f", HomingInterval = "0.5f", Lifetime = "5.f", AdvancedDisplay=12 ), Category = "TraceProjectiles" )
static UTraceProjectile* SpawnProjectile(
UObject* WorldContextObject,
const FVector Location,
const FVector Direction,
float Radius,
float Speed,
float Distance,
const FVector Gravity,
const FRotator Rotation,
ETraceTypeQuery TraceChannel,
bool TraceComplex,
const TArray<AActor*>& IgnoreActors,
UObject* AttachObject,
float Lifetime,
bool Fork,
int Chains,
float ChainsRadius,
int Bounces,
bool Pierce,
float Returns,
bool Homing,
float HomingRadius,
float HomingInterval,
float Pulse,
float GravityStart,
float RotationStart,
const FVector Constraints,
EDrawDebugTrace::Type DrawDebugType,
FLinearColor TraceColor = FLinearColor::Red,
FLinearColor TraceHitColor = FLinearColor::Green,
float DrawTime = 1.f );
Spawn Projectiles
UFUNCTION( BlueprintCallable, meta = ( BlueprintInternalUseOnly = "true", WorldContext = "WorldContextObject", AutoCreateRefTerm = "IgnoreActors", Speed = "1000.f", HomingRadius = "600.f", ChainsRadius = "600.f", GravityStart = "0.5f", RotationStart = "0.5f", HomingInterval = "0.5f", Lifetime = "5.f", AdvancedDisplay=12 ), Category = "TraceProjectiles" )
static TArray<UTraceProjectile*> SpawnProjectiles(
UObject* WorldContextObject,
int Projectiles,
const FVector Location,
const FVector Direction,
float Radius,
float Speed,
float Distance,
const FVector Gravity,
const FRotator Rotation,
ETraceTypeQuery TraceChannel,
bool TraceComplex,
const TArray<AActor*>& IgnoreActors,
float Lifetime,
bool Fork,
int Chains,
float ChainsRadius,
int Bounces,
bool Pierce,
float Returns,
bool Homing,
float HomingRadius,
float HomingInterval,
float Pulse,
float GravityStart,
float RotationStart,
const FVector Constraints,
EDrawDebugTrace::Type DrawDebugType,
FLinearColor TraceColor = FLinearColor::Red,
FLinearColor TraceHitColor = FLinearColor::Green,
float DrawTime = 1.f );
My Spawn Projectiles displays in editor as follows.
I want it to function exactly the same way except with Projectiles parameter to specify how many to spawn, but if SpawnProjectiles return type isn’t also UTraceProjectile* it won’t show up.
I’m just trying to move the loop that spawns projectiles out of BP and into C++, but it might not really be necessary. However I’d still like to know what I’m doing wrong here.
Then delegates are all like the following.
DECLARE_DYNAMIC_MULTICAST_DELEGATE_ThreeParams( FOnProjectileSignature, UTraceProjectile*, Projectile, FHitResult, Hit, bool, HasBlocking );
UPROPERTY( BlueprintAssignable, Category = "TraceProjectiles" )
FOnProjectileSignature OnCreated;
Maybe I need to be using the Latent meta here? I’ve no idea how to use that though so suggestions welcomed.