Description

If a static mesh component is added to a scene component class and the scene component is added to an actor - the static mesh that is assigned in the blueprint will not show up in the blueprint editor or the main editor viewport.

Steps to Reproduce
  1. Open UE4 Editor (any project)
  2. Add 2 classes to project based on SceneComponent (MyScene) and Actor (MyActor)
  3. Add the following code to MyScene.h:
    	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Test)
    	class USpringArmComponent* IndicatorArm;
    	UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Test)
    	class UStaticMeshComponent* IndicatorMesh;
    
  4. Add the following code to MyScene.cpp:
    IndicatorArm = CreateDefaultSubobject<USpringArmComponent>(TEXT("IndicatorArm"));
    	IndicatorArm->AttachTo(this);
    	IndicatorArm->TargetArmLength = 150.0f;
    	IndicatorArm->bUsePawnControlRotation = false;
    	IndicatorArm->SetHiddenInGame(false);
    
    	IndicatorMesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("IndicatorMesh"));
    	IndicatorMesh->AttachTo(IndicatorArm);
    	IndicatorMesh->bOnlyOwnerSee = true;
    	IndicatorMesh->SetSimulatePhysics(false);
    	IndicatorMesh->SetCastShadow(false);
    
  5. In MyActor.h add an include statement for MyScene and the following code:
    UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = BallIndicator)
    	class UMyScene* BallIndicatorComp;
    
  6. Add the following code to MyActor.cpp:
    BallIndicatorComp = CreateDefaultSubobject<UMyScene>(TEXT("BallIndicatorComp"));
    	BallIndicatorComp->AttachTo(RootComponent);
    
  7. Compile the code
  8. In the editor, create a blueprint based on MyActor
  9. Select BallIndicatorComp in the component list and extend the Ball Indicator Comp in Details panel
  10. Extend BallIndicator -> Indicator Mesh -> Static Mesh
  11. Set the static mesh to available mesh

Result:
No mesh appears in the viewport

Expected:
Mesh appears in blueprint/editor viewport after being set

Have Comments or More Details?

Head over to the existing Questions & Answers thread and let us know what's up.

0
Login to Vote

Won't Fix
ComponentUE - Gameplay - Components
Affects Versions4.9.2
CreatedNov 6, 2015
ResolvedAug 18, 2021
UpdatedAug 18, 2021
View Jira Issue