Child Actor Component Empty Details Panel in Parent Blueprint
I've been following along with Epic's C++ Tanks vs. Zombies demo stream on YouTube. There, they define a Child Actor Component for their pawn in C++, and, when they create a Blueprint based off of their C++ code, they can select the Actor to function as the child by selecting the component in the Blueprint Editor Viewport and selecting the desired asset in the Details panel.
However, when I replicate their steps, I do not get a populated Details panel on my Child Actor Component. The panel is empty, and I cannot access the values for the component; so I cannot set it through the Blueprint to the desired actor.
I can find my Get Child blueprint node in the Graph Editor when I search, and it is even under the category I defined it as. Its tooltip shows as the comment directly above my definition of the component, so I'm sure it's referencing the correct thing.
Still the Details panel is empty, so the Child Actor Component is functionally useless.
Here's a screenshot.
Here's my code for your reference.
Am I setting something up wrong?
After two years, one brilliant mind showed me the solution!
It turns out, I was doing variable declarations wrong. Allow me to elaborate:
.cpp file: RootComponent = CreateDefaultSubobject(TEXT("RootComponent"));
This causes issues, because both in the .h file and in the .cpp file, the variable is declared and memory is reserved for both. The MeshComponent in the .h and the MeshComponent in the .cpp are not the same variables when implemented this way. That's why we do get a Component added to our Blueprint, but it's not showing up as an editable value (because it's not been told that it wants a UPROPERTY()).
So, instead, we need to change our .cpp file to this: RootComponent = CreateDefaultSubobject(TEXT("RootComponent"));
See the subtle difference? The type specifier is no longer present in the .cpp file.
For some reason, the problem I had seemed to be that components declared in-line in the .cpp file do not get their variables added to the Details panel. Instead, I need to manually specify for each Component that it's a UPROPERTY() in the .h file.
Unfortunately, my RootComponent still has a blank Details panel. Still figuring out why that is.
I hope this helps someone else somewhere down the line.
answered Feb 20 '19 at 06:24 PM
This probably was changed in later version. Instead of 'meta', just try moving your vars from 'private' undo 'public' or 'protected'
answered Aug 12 '16 at 08:39 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here