Projectile with C++

Hello,
I am really new to Programming in C++ and wanted to know if anyone could explain a way to assign a projectile to an actor without using the blue prints. I have been following this tutorial but instead of using only C++ the author implements the type of projectile to be used through blue prints. I was wondering if there is a way it can be done purely through C++.
Thanks.

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