Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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. The Blueprint Editor showing the empty Details panel when selecting the Child Actor Component

Here's my code for your reference.

.h file:

 #pragma once
 #include "GameFramework/Pawn.h"
 #include "PlayerGodPawn.generated.h"
 class PROJECTJUPITER_API APlayerGodPawn : public APawn
     // Constructor declaration
     APlayerGodPawn(const FObjectInitializer& ObjectInitializer);
     // Sets default values for this pawn's properties
     // Called when the game starts or when spawned
     virtual void BeginPlay() override;
     // Called every frame
     virtual void Tick( float DeltaSeconds ) override;
     // Called to bind functionality to input
     virtual void SetupPlayerInputComponent(class UInputComponent* InputComponent) override;
     // Declare that we'll use a Scene Component called Dummy Root (it will be used for the root of the Actor)
     USceneComponent* DummyRoot;
     // Declare that we'll be adding a child actor component, which will have the skeletal mesh for the hand representing the player's position in the world
     UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Hand", meta = (AllowPrivateAccess =  "true"))
     UChildActorComponent* ChildHand;

.cpp file:

 #include "ProjectJupiter.h"
 #include "Components/ChildActorComponent.h"
 #include "PlayerGodPawn.h"
 // Sets default values
 APlayerGodPawn::APlayerGodPawn(const class FObjectInitializer& ObjectInitializer) : Super(ObjectInitializer)
      // Set this pawn to call Tick() every frame.  You can turn this off to improve performance if you don't need it.
     PrimaryActorTick.bCanEverTick = true;
     // Default root component needed for C++ classes; Blueprints create one on the fly
     RootComponent = DummyRoot = ObjectInitializer.CreateDefaultSubobject<USceneComponent>(this, TEXT("RootComponent"));
     // Use a spring arm to give the camera smooth, natural-feeling motion.
     USpringArmComponent* SpringArm = CreateDefaultSubobject<USpringArmComponent>(TEXT("CameraAttachmentArm"));
     SpringArm->RelativeRotation = FRotator(-65.f, 0.f, 0.f);
     SpringArm->TargetArmLength = 1000.0f;
     SpringArm->bEnableCameraLag = true;
     SpringArm->CameraLagSpeed = 3.0f;
     // Create a camera and attach it to our spring arm
     UCameraComponent* Camera = CreateDefaultSubobject<UCameraComponent>(TEXT("PlayerCamera"));
     Camera->SetupAttachment(SpringArm, USpringArmComponent::SocketName);
     // Attach the ChildActorComponent
     UChildActorComponent* ChildHand = CreateDefaultSubobject<UChildActorComponent>(TEXT("PlayerHand"));
     // Take control of the default player
     AutoPossessPlayer = EAutoReceiveInput::Player0;
 // Called when the game starts or when spawned
 void APlayerGodPawn::BeginPlay()
 // Called every frame
 void APlayerGodPawn::Tick( float DeltaTime )
     Super::Tick( DeltaTime );
 // Called to bind functionality to input
 void APlayerGodPawn::SetupPlayerInputComponent(class UInputComponent* InputComponent)

Am I setting something up wrong?

Product Version: UE 4.12
more ▼

asked Jul 22 '16 at 09:43 AM in C++ Programming

avatar image

91 18 20 21

avatar image LostFocusReason0 Oct 30 '18 at 02:55 PM

Any luck finding a soloution? I´m experiencing the exact same issue...

avatar image Shrooblord Feb 20 '19 at 01:09 PM

Apparently there is an ongoing thread about a very similar issue here: https://forums.unrealengine.com/development-discussion/c-gameplay-programming/57024-inherited-component-details-not-showing-in-blueprint/page2

Epic has since opened a bug report, and are working to resolve it. I hope this will resolve the behaviour you see described here, too.

It's also possible I just set something up wrong. I'm still working on a situation much like this right now and trying to figure out how to get my UComponents to show up in a derived BP's Details panel for them.

avatar image LostFocusReason0 Feb 20 '19 at 04:33 PM

Thanks for the update. For now I gonna stick with compiling my code in VS before opening Unreal Engine Editor. This way it works for me. I think the issue might be somewere in the hot reload for C++ Code.

avatar image Shrooblord Feb 20 '19 at 06:25 PM

See the answer I posted just now. It may help if you happen to have the same setup.

avatar image Dune Feb 20 '19 at 03:05 PM

I think looking at the constructor code, this old thread looks like the person was creating another local variable called 'ChildHand'.

 // Attach the ChildActorComponent
      UChildActorComponent* ChildHand = CreateDefaultSubobject<UChildActorComponent>(TEXT("PlayerHand"));

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

2 answers: sort voted first

After two years, one brilliant mind showed me the solution!

It turns out, I was doing variable declarations wrong. Allow me to elaborate:

.h file:

 UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Components")
 class USkeletalMeshComponent* MeshComponent;

.cpp file: RootComponent = CreateDefaultSubobject(TEXT("RootComponent"));

 USkeletalMeshComponent* MeshComponent = CreateDefaultSubobject<USkeletalMeshComponent>(TEXT("MeshComponent"));

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"));

 MeshComponent = CreateDefaultSubobject<USkeletalMeshComponent>(TEXT("MeshComponent"));

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.

more ▼

answered Feb 20 '19 at 06:24 PM

avatar image

91 18 20 21

avatar image Risky Click Apr 11 '19 at 09:54 AM

I just wanted you say this solution worked. Thank you so much.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

This probably was changed in later version. Instead of 'meta', just try moving your vars from 'private' undo 'public' or 'protected'

more ▼

answered Aug 12 '16 at 08:39 PM

avatar image

0 1 4

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question