Hi.
I created a simple weapon that fires using line trace. Since there’s no way to detect if an object has been hit with a line trace (if there is let me know) I have to create the damaging system in the player class. I tried this:
if (FireHit.Actor->GetClass()->IsChildOf(ANPC::StaticClass()))
{
ANPC* HitNPC = FireHit.Actor;
HitNPC->Damage(10.0f);
}
But we cannot just assume that the actor is a child of ANPC class so that doesn’t work.
I honestly have no idea how to do this.
If you know how to help me, then please post an answer to my question.
Thanks!