Projectile and sphere collision question
I have a projectile firing at an actor/pawn. How to do you have the pawn register that the projectile hit/came in contact with it?
I know it has something to do with the collision spheres around the projectile and the pawn. But im not sure how.
I tried tagging the pawn's sphere as 'Enemy' then telling the projectile to destroy when it comes in contact with something tagged 'Enemy' but that's not working for some reason?
Is this the proper way of doing this, or is there a better or more widely accepted way?
asked Aug 12 '18 at 05:25 AM in Using UE4
First Check what is the Collision type of the pawn's collision sphere/capsule
In this case it's pawn.
Then depending on if you want the Pawn or the projectile to register the hits add an overlap event. In this case the hit is registered on the Pawn. You may want to add a "projectile" object type so you can set all projectiles types to that. You can add a object type from the Project Settings
Set the default response to overlap. Then in your projectile actor set you collision component's Object type to the newly created Projectile type and the response to Overlap the same channel your pawn was.
Then in your pawn blueprint create Begin Overlap event for the collision Sphere
You can do whatever you want in the place of my "Lose Health" function". For example, you can destroy the projectile after hitting the pawn.
Follow this question
Once you sign in you will be able to subscribe for any updates here