Newbie Casting Problem

Hi there,

can someone tell me the differences between:



TArray<AActor*> CollectedActors;
CollectionSphere->GetOverlappingActors(CollectedActors, TSubclassOf<APickup>());

//(1)
APickup* const TempPickup = static_cast<APickup*>(CollectedActors*);

//(2)
APickup* const TestPickup = Cast<APickup>(CollectedActors*);

It should be the same; isnt it?
with (1) I got an UE-Editor crash.
with (2) It works.

Thanks!

The first one is a static cast which is at compile time. In UE4 gameplay code, you will use dynamic casting (the second one) 99% of the time. Google these terms (static casting, dynapic casting), to get an understanding of them, they are not Unreal specific.