I figured out what my issue is and it stems from me being a C++ programmer and being new to Unreal Engine 4.
In my BaseProjectile (ASpellWorldProjectile), I have instance variables/member variables for
- Projectile movement component
- Collision component
But nothing for the SkeletalMesh which is the visual representation of our BaseProjectile. So when I inherit from BaseProjectile I should get all the data associated with the parent but where does the SkeletalMesh come into play? Why is my projectile working fine but it is invisible/not being rendered?
The answer is because Unreal Engine 4 manages assets for you meaning you don’t make a SkeletalMesh instance variable but instead you create a blueprint that has your C++ code and attaches the SkeletalMesh to the blueprint. Essentially, the blueprint ties together your visual representation and your C++ class.
Below are the steps I did to tie my C++ code to the blueprint.
First we need to make the blueprint so double click the blueprints folder to navigate to it.
http://i.imgur.com/tqEFrPO.png?1
Right click in the folder and create a new blueprint, Have this blueprint inherit from your child class (In my case ARandomProjectile).
https://i.imgur.com/mmKfjpR.png
Open up the blueprint we just made and click the button “Add Component” to add our SkeletalMesh to the blueprint. (You might need to zoom out to see the yellow sphere mesh).
https://i.imgur.com/Itxo6dL.png
Modify the data of the new SkeletalMesh to use the same mesh from the Base Projectile. Make sure to compile the blueprint when done.
http://i.imgur.com/rGNEQGJ.png
Now we need to tell the player to use the ARandomProjectileBlueprint we just made because if we just tell the character to use ARandomProjectile, it will be invisible.
http://i.imgur.com/Gmrm4op.png
Last but not least make sure that in the blueprint for the character, its using our new blueprint. Make sure to save all and click compile for this blueprint as well.
http://i.imgur.com/UmXZd2R.png
I hope this was helpful, This fixed the issue for me perfectly.