Custom component and existing blueprints
Hello, Today I tried creating some custom components and ran intro a problem. This is how the class looks like:
Nothing fancy really, no overriding or anything. Then I decided to add it to my character:
and create it inside the constructor like this:
In my game I have a blueprint that inherits from my character. Once I opened the blueprint I saw that my component is there but it was actually empty: I found this thread on the forums that reported a similar issue: I decided to try create a new blueprint that inherits from MyCharacter and see if it would work. Turns out, it solves the problems. Still it would be nice if this bug was fixed as recreating blueprints every time might be difficult and impractical.
(comments are locked)
|
Follow this question
Once you sign in you will be able to subscribe for any updates here
It's a pity these issues still exist with 4.8, component problems like this have been around for ages and make it a real pain to develop c++ and blueprints concurrently. Your problem is very similar to one of those linked here, which was apparently fixed for 4.8.
Sad to hear that indeed. I really like using both C++ and blueprints at the same time. C++ for the "heavy lifting", bluperints to quickly prototype new ideas and easily change data. I hope that those issues will be fixed eventually.
Hey Swiftle-
Can you explain in more detail how you're setting up your character and sphere component? I created a new character class and new sphere component class. After creating a blueprint based on the character class I added a pointer reference to the new sphere component based on the code you provided. After compiling the code (triggering a hot reload) the ShiledComponent showed up in the blueprint's Viewport and all of the properties in the details panel were editable except for the name which is expected since it is named in code.
Cheers
Doug Wilson
Hey Doug,
The setup was as described above. I created a component and wanted to add it to my existing Character class. I had a blueprint that inherited from that class. When I added the pointer to the component inside .h and .cpp files the BP would have a null component.
The problem is that I just tried to reproduce the issue on a new project and couldn't do it.
Started a new CPP TPS project.
Deleted the default character BP and created my own
Created my own Sphere Component class and added a pointer to it inside the Character .h and .cpp files.
Everything worked fine even with the editor open.
Additionally I tried creating a Game Mode BP and setting it as default because I thought it might be related somehow but it wasn't the case.
Sorry that I can't help you further.