Why does my Editor Crash when i make changes to my Blueprint?

So i made a class derived from AActor::

And added two Components like this.
protected:

	UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "barrel Mesh")
		TSubobjectPtr<UStaticMeshComponent> StaticBarrelMesh;

	UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = "Barrel Capsule")
		TSubobjectPtr<UCapsuleComponent> BarrelCapsule;

And in my constructor i did this.

	StaticBarrelMesh = PCIP.CreateDefaultSubobject<UStaticMeshComponent>(this, TEXT("StaticBarrelMesh"));
	if (StaticBarrelMesh)
		RootComponent = StaticBarrelMesh;

	BarrelCapsule = PCIP.CreateDefaultSubobject<UCapsuleComponent>(this, TEXT("BarrelCapsule"));
	if (BarrelCapsule)
		BarrelCapsule->AttachParent = RootComponent;

Is this the correct way of doing it since when i try to change somthing in a Blueprint derived from this class my Editor crashes when i press compile.

Anyone have the time to answer ?
Thanks :slight_smile:

Hi ,

Can you provide a little more information about what changes you are making in your Blueprint? I created a class using your code, then made a Blueprint from that class, but I am not sure what changes you are making before your Editor crashes. Are you clicking Compile in the Blueprint window, or at the top of your Editor? What version of the Editor are you using?

Also, when your Editor crashes, could you please copy the crash report , and make sure you submit the crash report as well.

Thanks

Hi ,

We have not heard back from you in a few days, so we are marking this post as Resolved for tracking purposes. If you are still experiencing the issue you reported, please respond to this message with additional information and we will offer further assistance.

Thank you.

It was due to a coding error on my side.
Forgot to close this thread, my bad.

Aprichiate the follow up.
Keep up the great work.

Hi ,

I changed your comment into an answer so I can indicate that you found a solution to the issue. Would you mind explaining what code changes you made to resolve this in case someone else is experiencing a similar issue?