OnComponentHit.AddDynamic

Hello.
I’m trying to make a fps game and I’m using the official (I thing) [FPS Tutorial][1] from UE Wiki.
I made the shooting mechanic and now I’m trying to make the projectiles interact with the world. I don’t want explosion or anything, because I want to just make them kill enemies (I’ll later make a simple HP System) and destroy themselves when they hit for example a wall. So first I need a function that will be called whenever the projectile will hit something. I did everything they wrote in that tutorial but I get an error. Here’s an image:

How can I fix this?

1 Like

It worked! Thank you very much!

You appear to be missing an argument in your function signature. The signature is declared as follows

DECLARE_DYNAMIC_MULTICAST_DELEGATE_FiveParams( FComponentHitSignature, UPrimitiveComponent*, HitComponent, AActor*, OtherActor, UPrimitiveComponent*, OtherComp, FVector, NormalImpulse, const FHitResult&, Hit );  

So your function signature would look like:

void YourFunction(UPrimitiveComponent* HitComponent, AActor* OtherActor, UPrimitiveComponent* OtherComponent, FVector NormalImpulse, const FHitResult& Hit);
1 Like

Works perfectly!! Thanks!

Hello. I have a question, where did you find the function signature?