In my projectile class I create a Collision Component that is based off of the UCapsuleComponent:
CollisionComp = ObjectInitializer.CreateDefaultSubobject<UCapsuleComponent>(this, TEXT("Collision"));
CollisionComp->OnComponentHit.AddDynamic(this, &AMyProjectile::OnHit);
RootComponent = CollisionComp;
I would rather use the collision component that is already created in the BP editor but I don’t know how to get it. Does anyone know how to access the collision component in C++?
Also, should Collision -> Customized Collision be checked?
Should I add my own collision handling function to the component, as done above (::OnHit), or should I have ::ReceiveHit()? What is the recommended way of handling this?
Thank you.