[HELP] Custom C++ Component Disappearing When Placed in Level

I added the UCLASS(ClassGroup=(Custom), meta=(BlueprintSpawnableComponent)) macro, so it shows up in the details panel when I open the Blueprint, but when I place it in the level, it disappears.

I added the CDO in the constructor like the code below

//header
	UPROPERTY(EditAnywhere, Transient)
	UXRBeamSplineComponent* XRBeamSplineComponent;

//Constructor
	XRBeamSplineComponent = CreateDefaultSubobject<UXRBeamSplineComponent>(TEXT(XR Beam Spline Component));
	XRBeamSplineComponent->SetupAttachment(RootComponent);

// Component Visible in Editor when viewing Blueprint
image

// Component Disappears from Details Panel when placed in level
image

UCLASS(Blueprintable, BlueprintType)
class YOUR_API UXRBeamSplineComponent : public USplineComponent
{
	GENERATED_BODY()
	
};

And inside of actor property, CDO is the same as your one.

UPROPERTY(BlueprintReadWrite, EditAnywhere, Transient)
UXRBeamSplineComponent* XRBeamSplineComponent;

Component visible in details once placed in world.

I think the problem was my misuse of the Transient keyword. Somewhere along the line, I think I deleted the specifier and it just broke the code or something.

I’m not sure if I understood the Transient UPROPERTY properly, but I thought that the variables would not be serialized. But from the behavior, it seems like the “don’t serialize” property was serialized.