I am extremely new to UE4, and I have a question. I have a gun that shoots projectiles, and there are two kinds of projectiles. They both belong to the same class (Projectile) but are different actors. I cannot figure out how to switch between them. Here is a bit of my code:
//Header
/** Projectile class to spawn */
UPROPERTY(EditDefaultsOnly, Category=Projectile)
TSubclassOf<class AMageDeflectionProjectile> ProjectileClass;
//.cpp file
World->SpawnActor<AMageDeflectionProjectile>(ProjectileClass, SpawnLocation, SpawnRotation, ActorSpawnParams);
This code is from the pre-made 1st person shooter code, and the sample projectile actor is always the default one, and I am unsure how to switch it to a different one if desired.