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.
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Test) class USpringArmComponent* IndicatorArm; UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Test) class UStaticMeshComponent* IndicatorMesh;
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);
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Category = BallIndicator)
class UMyScene* BallIndicatorComp;
BallIndicatorComp = CreateDefaultSubobject<UMyScene>(TEXT("BallIndicatorComp"));
BallIndicatorComp->AttachTo(RootComponent);
Result:
No mesh appears in the viewport
Expected:
Mesh appears in blueprint/editor viewport after being set
Head over to the existing Questions & Answers thread and let us know what's up.
0 |
Component | UE - Gameplay - Components |
---|---|
Affects Versions | 4.9.2 |
Created | Nov 6, 2015 |
---|---|
Resolved | Aug 18, 2021 |
Updated | Aug 18, 2021 |