Implement Custom Actor Component
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:
Then in the ArenaCharacter.cpp file I initialized the component with the below code:
This did the job of showing all the ArenaCharacterAttributes variables in the ArenaCharacter blueprint, under the CharacterAttributes component.
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?
asked Jun 16 '15 at 12:25 AM in C++ Programming
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.
http://pastebin.com/8tKPdgNt http://pastebin.com/JK2tRVY1 http://pastebin.com/KXgqWAqb http://pastebin.com/HX6pPzSv
I hope this helps!
answered Jun 18 '15 at 09:51 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here