Unable to set defaults on *some* BP components

I’m on 4.6 and currently having this problem. I have two blueprints extending some C++ (BalloonPopUp.h, MarbCannon.h) which both inherit a UStaticMeshComponent* from a parent class (Pickup.h) and one has a Pickup Mesh which is broken while the other’s Pickup Mesh is just fine. For one of the components I can’t set any of the defaults. I’ve restarted, recompiled, etc and nothing’s changed.

/**Pickup.h*/
UCLASS()
class MAXIMUMTOPSPIN_API APickup : public AActor
{
	GENERATED_BODY()

public:
	APickup(const FObjectInitializer& ObjectInitializer);

protected:
	bool bIsActive;

	UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Ball, meta = (AllowPrivateAccess = "true"))
	USphereComponent* CollisionSphere;

	UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Ball, meta = (AllowPrivateAccess = "true"))
	UStaticMeshComponent* PickupMesh;
};

/**PopUpBalloon.cpp*/
APopUpBalloon::APopUpBalloon(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
	static ConstructorHelpers::FObjectFinder<UStaticMesh> BalloonMesh(TEXT("/Game/Meshes/BallMesh.BallMesh"));

	PickupMesh = ObjectInitializer.CreateDefaultSubobject<UStaticMeshComponent>(this, TEXT("Balloon0"));
	PickupMesh->SetStaticMesh(BalloonMesh.Object);
	PickupMesh->AttachTo(RootComponent);

	//. . .
}

/**MarbCannon.cpp*/
AMarbCannon::AMarbCannon(const FObjectInitializer& ObjectInitializer)
: Super(ObjectInitializer)
{
	static ConstructorHelpers::FObjectFinder<UStaticMesh> CannonMesh(TEXT("/Game/Meshes/BallMesh.BallMesh"));

	PickupMesh = ObjectInitializer.CreateDefaultSubobject<UStaticMeshComponent>(this, TEXT("Cannon0"));
	PickupMesh->SetStaticMesh(CannonMesh.Object);
	PickupMesh->AttachTo(RootComponent);

	//. . .
}

If I were to hazard a guess, I would say it’s a problem with having Mesh Components sharing a mesh asset.

A workaround may be to instance the mesh, but I don’t see any good way of doing that. I’ve tried simply duplicating the asset in the content browser, but that hasn’t fixed it.

From looking around, this seems to be a problem that people a lot of people have had (also known as the “component shows as ‘none’” problem) and even if there is some solution, something should probably be changed.

To add where I’ve gotten on this: It most definitely seems like a bug. I created a new blueprint from the exact same script that was bugged before. The mesh component in ‘NewCannon’ isn’t having the ‘none’ problem, though the old one still is.

Hi Slowmanrunning,

Sorry for the delay in responding to your post. I ran some tests and was able to see the results that you described, but this only happened if I created the MarbCannon Blueprint without anything in the class constructor, then filled in the constructor code and performed a hot reload. Can you confirm whether or not you were doing something similar when you saw this happening?

I attempted to perform the same test in our latest internal build of the Engine but ran into an unrelated issue that prevented me from being able to do so. I’ll give that another try tomorrow.

Hi Slowmanrunning,

After running some tests with this issue (which turned up two additional issues), I was able to reproduce the behavior that you described. I have submitted a report about what I found to have this investigated further (UE-8674).

It appears that a possible workaround for this issue would be to close and re-open the Editor. Have you seen any positive results when doing that?