Description

Adding a UStaticMeshComponent pointer to a class derived from StaticMeshComponent allows for two meshes to be set by a single component. Setting two meshes inside a blueprint this way will only allow one of the meshes to be edited by selecting it (the second component can only be edited through the Details panel). If an instance of the blueprint is added to the level, the uncontrolled mesh will appear at world origin. Colliding with the "ghost" component will cause it to shoot off.

Steps to Reproduce

1. Open UE4Editor (code project)
2. Add code to project based on StaticMeshComponent(TestComponent)
3. In TestComponent.h add the following:

UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = test)
UStaticMeshComponent* MyMesh;

4. In TestComponent.cpp add the following to the constructor:

MyMesh = CreateDefaultSubobject<UStaticMeshComponent>(TEXT("MyMesh"));

5. Compile
6. Create Blueprint based on TestComponent (TestComponentBP), and an actor blueprint (TestBP)
7. Add component "Test" to the blueprint
8. In the Details panel add a static mesh to each of the StaticMesh slots
9. Place BP instance into the level

Result:
Cannot select second mesh in BP viewport to edit transform. Interacting with component in PIE has unexpected results.

Have Comments or More Details?

There's no existing public thread on this issue, so head over to Questions & Answers just mention UE-19747 in the post.

0
Login to Vote

Cannot Reproduce
ComponentUE - Gameplay - Components
Affects Versions4.8.34.9
Fix Commit12145988
Release Commit12145988
CreatedAug 6, 2015
ResolvedMar 12, 2020
UpdatedMar 12, 2020
View Jira Issue