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"

Projectiles colliding with static meshes etc.

In my game the player fires projectiles that should impact with walls and enemies etc. For now I have used the event ActorBeginOverlap to do this and it works fine, except for one detail, that I have to set Generate Overlap Events to true on all the walls and objects in all of my levels. Is there a smarter way to check for collision or a way to make all those meshes automatically generate overlap events or something where I don't have to check a bool on all objects in every level.

Product Version: UE 4.10
more ▼

asked Mar 29 '16 at 02:39 PM in Blueprint Scripting

avatar image

6 3 6 6

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

1 answer: sort voted first

Are you sure you have to set the flag on both actors? I'm pretty new to UE4 myself, but I think it should be enough to set the flag on the actor you want to trigger the event, as long as the collision channel settings of both actors allow an overlap/collision to be created. Is it possible that you don't have the walls/enemies/... set to respond with overlap to whatever channel you are using for the projectile? You might want to use an extra channel for your projectile anyway and you can set the default response to overlap. Then you don't have to manually set any flags at all.

more ▼

answered Mar 29 '16 at 03:17 PM

avatar image

643 67 82 118

avatar image CaretCaret Mar 29 '16 at 03:22 PM

I have tested and it says when you hover over the blueprint node.

"Components on both this and the other Actor must have bGenerateOverlapEvents set to true to generate overlap events."


avatar image MaxPower42 Mar 29 '16 at 04:00 PM

Hmm. I only work with code and I just tested a little with my own projectiles, which are currently using collisions instead of overlaps (probably gonna change that soon). I disabled the generate-hit-events flag on a character mesh and the projectile still triggered the event when hitting that character. But I never did this with blueprints, so no idea... Or maybe overlaps and collisions work differently in that respect.

Anyway, I would still check the collision channel settings to see if an overlap is even possible.

avatar image MaxPower42 Mar 29 '16 at 04:32 PM

I just made a simple blueprint-only setup with an overlapping projectile using the OverlapAllDynamic profile. Hit events fire without having set the overlap event flag on other actors. Have you tried using both the actor-event and the component-event for BeginOverlap?

edit: Ok this is weird... at first it was working, then I played around with it a little and now it's not :/ It's not the prettiest solution, but if you just don't want to set the flag manually, you can either derive a new actor class or mesh component that simply sets the flag on construction. Or you iterate through your actors procedurally and set the flag that way.

Depending on how your projectiles move, you could also sweep them "manually" every frame. That way you always get hit/overlap info.

Since I want to use overlapping projectiles too, I will keep experimenting and let you know if I found a better solution.

(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