I created a custom UActorComponent call ArenaCharacterAttributes. The character of my game is called ArenaCharacter. I created the ArenaCharacterAttributes component because I didn’t want the ArenaCharacter to become blotted with code, however I wanted all of the characters variables to be easily edited from within the editor.
What I have done so far is I added the code below to my ArenaCharacter.h file:
However when I edit the defaults of the CharacterAttributes in the editor, it doesn’t apply to the CharacterAttributes C++ counterpart. How do I make it so when I edit the defaults in the editor, those changes also apply to the code?
The reason this doesn’t work in the way you’re attempting is because the blueprint itself is a child of the C++ class. According to all of the code in the C++ class, this blueprint doesn’t exist and none of those values you’re setting have been set. What type of function calls are you attempting to make in code that use these values?
I’m not 100% sure that it would, but you could try it risk free by downloading the engine and making a copy of your project before converting, in case anything goes wrong in the conversion process.
I tried doing this myself without any issues at all, even the ones I mentioned so I apologize for that. The following is what I did to recreate this:
First I made two classes, an Actor and an Actor Component. I then gave a couple variables to the component and gave the Actor the component itself. After that, I set up a debug message to print out one of the variables from the component on tick which updates if I change the variable in the details panel of the blueprint instead of the code, as you were attempting to do. Here are a few pastebin links of all of the code files.