Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

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?

Product Version: UE 4.20
more ▼

asked Aug 12 '18 at 05:25 AM in Using UE4

avatar image

64 4 6 9

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

First Check what is the Collision type of the pawn's collision sphere/capsule alt text

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 alt text

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. alt text

Then in your pawn blueprint create Begin Overlap event for the collision Sphere alt text

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.

more ▼

answered Aug 12 '18 at 01:38 PM

avatar image

Eelis Otsamo
55 1 5 7

avatar image Plzwork1234 Aug 12 '18 at 04:46 PM

Wow thank you. Very in-depth answer. I didnt even know you could make a new object like that.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question