Hey I just thought I would add something relevant to you.
To set your projectile class you would have to extend the class to a derived blueprint and set it there. Or alternatively you can get it in code like this.
Well when i pressed F12 on AProjectile in this part: TSubclassOf (before i had the A) vs didnt load the class, after that it did. But in runtime i hadn’t a link to a class so ive made id:
When the MainCharacter is placed in the scene, on the right side you can set the projectile, if you need to spawn your character in game you might try the other solution.
The on Jakey113G posted. That solution was handy for me to define a material and static mesh, im also going to use that for the class so i don’t need to set the UPROPERTY everytime.
Yes, but in the H you dont call it already, only if you use UPROPERTY(EDITAnyWhere)
so you can choose in the engine the correct file.
See image,
I can choose between none and Projectile.
If i choose None it will be NULL because i’ve selected projectile, it isn’t null but has a value (Projectile)
Are you definitely setting it, it sounds like it isn’t being set?
Security20 was suggesting you add the actor and then set the projectile class from the details panel, however that won’t work unless you do what Security20 did which is change the UPROPERTY macro to enable editing from there. Alternatively you can convert your C++ class into a derived blueprint and access and set the class within the blueprint.
//Default in the first person shooter c++ template
UPROPERTY(EditDefaultsOnly, Category=Projectile)
//UPROPERTY Change security used to edit from the scene details menu
UPROPERTY(EditAnywhere, Category = Projectile)