Hi,
I want to receive a Hit Event when my Pawn bumps into another object. I created my Pawn Class in C++ and Subclassed in in Blueprint. It has a StaticMeshComponent as its RootComponent. I overrode (is that a word? ) ReceiveHit in C++:
void AShipPawn::ReceiveHit(UPrimitiveComponent * MyComp, AActor * Other, UPrimitiveComponent * OtherComp,
bool bSelfMoved, FVector HitLocation, FVector HitNormal, FVector NormalImpulse, const FHitResult & Hit)
{
Super::ReceiveHit(MyComp, Other, OtherComp, bSelfMoved, HitLocation, HitNormal, NormalImpulse, Hit);
if(Mesh)
{
// Whatever ...
}
}
The event never fires.
I read that I have to enable “Simulation Generates Hit Events”, but the Details Panel in my Blueprint doesn’t show it:
I also tried binding on the StaticMeshComponents’ OnComponentHit Event, but that one doesn’t fire either.
Am I missing something? Can I set the “Generates Hit Event” status form C++?
Edit: I’m using Unreal Engine 4.7.1 btw.
Edit 2: eXi, why have you accepted the answer as correct? It provides a workaround, but I refuse to accept this as a permanent solution to the problem! If I think an answer is sufficient, I will happily accept it myself! Unfortunately I don’t have the permissions to remove the “Accepted” mark. I was hoping for more suggestions regarding this issue. If there is no way to do this in UE4, please simply tell me or let me file a bug report!
Thanks for your Help!
David