I have two actors in my project, sometimes AI Pawn is causing a collision and sometimes a Player is causing it. Is there a way to distinguish it?
I have two actors in my project, sometimes AI Pawn is causing a collision and sometimes a Player is causing it. Is there a way to distinguish it?
Both in C++ and Blueprint, collision events give you a FHitResult (displayed as just HitResult in BP). Here is reference.
This result contains both the Actor and Component that was hit/overlapped/traced.
So, the object calling the collision event is first object, and YourFHitResult.Actor is the other object.
In BP, you can use the break hit result node to get the actor/component.