Hey guys sorry if this comes across as a stupid question, Im coming over from Unity and am getting confused on UE4’s version of GetComponent.
I have a sphere collider component attached to a projectile blueprint that I am trying to access via c++. However when I try to do so, the editor crashes.
This is how I am trying to get a refrence to this existing BP component via C++
.h
class USphereComponent* Collision;
.cpp
Collision = this->GetOwner()->FindComponentByClass<USphereComponent>();
Below you can see the collision component attached.
If anyone could explain to me why this would cause a crash and a potentiol soloution I can use going forward for these types of scenarios I would be very greatful.