Projectile with C++

Hello,

The easiest way to figure this out is by heading into a First Person C++ project, and looking at the Character classes in code. There, you’ll be able to see how they define the projectile class that they want to spawn in the Character.h:

UPROPERTY(EditDefaultsOnly, Category=Projectile)
	TSubclassOf<class AMyProjectProjectile> ProjectileClass;

and you will also be able to see how they spawn the projectile in the Character.cpp:

World->SpawnActor<AMyProjectProjectile>(ProjectileClass, SpawnLocation, SpawnRotation);

With this information in mind, you can simply change the ProjectileClass variable to reference the projectile class that you’ve created in code, and then set that as the class to be spawned.

Let me know if you need any further information, or if you are having trouble figuring it out.

Have a great day