Break out Part of Character into a Separate Class and Instantiate it as a Blueprint
I have what may be a pretty specific question. I have a character called MyCharacter. I want to create a UObject class called MyCharacterStats. MyCharacterStats will have the characters stats like health, strength and stamina and getters and setters for each stat.
So all the above is fine, now it gets a little tricky. I want to add a
What I want to do is create a Blueprint instantiation of MyCharacterStats. Then in the editor I can easily assign the MyCharacterStats blueprint to MyCharacter. This will make it easy to create multiple stat load out that we can swap in and out and easily change
Now the problem I am having. The blueprint of MyCharacterStats is a different type than the:
Which means I can't assign the blueprint to that property in the editor. So I did the following:
This allowed me to assign the MyCharacterStats blueprint to the UPROPERTY of MyCharacter, in the editor. Now lastly I want to do this:
But when I do this CharacterStats is all NULL. It seems like things aren't being initialized. if anyone has any experience with this or any ideas I would really appreciate the help!
asked Jun 14 '15 at 11:14 PM in C++ Programming
I just figured it out. Instead of:
Do this instead:
answered Jun 14 '15 at 11:36 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here