I’m attaching “skills” to the player as Actor Components.
I have a c++ class that derives from UActorComponent called BaseSkill
Then I have a class that derives from BaseSkill called SkillBuilder
I cannot attach these in the constructor, because they can change at runtime, therefore I want to use the NewObject function within the ACharacter class to create them as needed.
FName BuildName = "Builder Skill"; BuildSkill = NewObject<UActorComponent>(this, USkillBuilder, BuildName);
But I get the error:
C2275 'UBaseSkill': illegal use of this type as an expression
How do I use NewObject to spawn and attach an actor component then? This seems to match all the examples I’ve seen online.
Thanks in advance.