USphereComponent causes break point and crash UE

Hi everyone!

I’m totally new to UE so I followed a quick tutorial on Youtube (official UE tutorial “Introduction to UE4 Programming”).

Everything is alright until I come to those 2 lines :

UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Pickup)    
TSubobjectPtr<class USphereComponent> CollectionSphere;

As soon as I try to “Start new Instance”, Visual Studio has a break point.
If I click “Continue”, Unreal Engine crashes, and everytime I try to reopen my project, it crashes again.

I started all over again and the same thing happened.

I am using UE 4.3.1 (added after edit)

I am not trying to make my projects work again, I’m only wondering why those line
causes this crash? And what Component could do the same thing as USphereComponent?

Thanks a lot!

if it’s 4.6 + try
UPROPERTY(Category = Mesh, VisibleDefaultsOnly, BlueprintReadOnly)
class USphereComponent* CollectionSphere;

if it’s the root component try
Have you tried just doing RootComponent = PCIP.CreateDefaultSubobject(this, TEXT(“CollisionComp”)); ?

^ This is not tied to my header file of my pawn.’

but any case they don;t want you to use TSubobjectPtr anymore so that could be why(?)

Yes the first solution worked fine, thank you!

So here’s the exact solution for my problem:

UPROPERTY(VisibleAnywhere, BlueprintReadOnly, Category = Pickup) 
class USphereComponent* CollectionSphere;

np ^ ^ i like the new way, it’'s simpler