2D Game: No trigger on overlapping sprites

Hi,

I’m very new to Unreal. I have a 2D game where a bullet sprite is passing through an asteroid sprite. I want an overlap between the two to trigger an event (destroy the asteroid).

I have the objects placed as sprites - I imported images with transparency, converted them to sprites, gave them blueprints to move them once spawned, and I spawn them from the level blueprint.

I have OverlapAll on both the bullet and the asteroid, but no event triggers when they overlap. Since that wasn’t working, I created a wide box brush that everything in the game passes through. I set it to OverlapAll as well, but I still get no trigger on the bullets or the asteroids.

See attached images; the blueprint is on the asteroid - I was attempting to have it destroy itself when it overlaps anything. Am I not getting overlaps because I’m using sprites instead of something else?

Thanks in advance for any help. :slight_smile:

could you not just add a box or other shaped component to catch the collision and overlap events?

Good suggestion. I just tried that, and I must be doing something really wrong as far as collision and overlapping, because I can’t get anything to detect overlaps. I swapped out my bullet sprites for a box static mesh (“test8” in the below image), and I’m having it pass right through the player’s static mesh (“mainPlayer” in the below image), and I’m getting no overlap events at all. Shouldn’t two static meshes passing through each other trigger an overlap event?

After some more testing, it appears as though only Pawns are causing overlaps. I can’t get any other objects to generate overlap events. What am I missing?

Ok I will be happy to help you further but if you haven’t checked the documentation on collision and overlaps you might have missed a step and this could help

Overlap Doc

Thanks, I’ve just spent the past hour reviewing the documentation, and as far as I can tell I’m doing it right. It seems as though sprites are supposed to be able to trigger overlaps.

At this point I’m just trying to get a moving sprite to overlap with a trigger volume. I think if I can get the sprite to trigger an overlap when it collides with the volume, then I can figure out the rest myself (getting the sprite to overlap with other sprites).

My current setup is that I spawn an actor that is a sprite with its own blueprint, which moves (transforms) it across the screen. It passes through the trigger volume, which in the level blueprint is referenced by a OnActorBeginOverlap and told to destroy all actors that pass through it. If I pass my pawn through the volume, it’s destroyed. But the sprite passing through the volume does not trigger an overlap.

Both the sprite and the volume have “Generate Overlap Events” checked, and “OverlapAll” selected under their presets.

Im not sure …I don’t see how sprites can create overlaps without COLLISION. have you looked at Tappy Chicken?

The chicken looks like a sprite but really its a mesh with a texture on it. Because I think in order for you to have an overlap you will need a collision box. Now I think that if you add a BOX or Sphere component to your blueprint and use it to fire the overlap events it will work fine I have tested this with just a box and sphere it worked everytime they crossed and overlapped. You just make it the ROOT for the blueprint and you can configure its shape pretty good.

Also if you do check out Tappy Chicken the asset is called SM_Player_01

Also if you have a static mesh WITHOUT a collision mesh it will not generate hit, overlap or any triggerable events .

I created a static mesh for each of my objects, and then gave them collision meshes like you said, and it worked! Now everything overlaps properly and my events are triggering correctly. Thanks so much for your help! I really appreciate it!