Download

Collision Handling: Cube vs Box

I am making a twin stick shooter, and I noticed that my projectiles were going through the walls I created instead of being destroyed on collision. I created these walls using the Geometry > Box mesh, with no other modification to the meshes. However, I switched out the Box mesh for the Basic > Cube mesh, and my projectiles were being destroyed on collision once I set the Generate Overlap Event checkbox to true under Details > Collision. Can someone explain to me why the Cube mesh was able to handle collision detection with my projectile and why the Box mesh wasn’t?

“Geometry > Box” It’s a brush, not a mesh. Brushes are meant to help the level design and therefore they are temporary. They should be replaced by meshes or converted into one at the end.

If you want to keep the brushes and destroy the projectile when it hits the “brush” wall, you can use a OnComponentHit event in the projectile.

You can also convert the brush into a static mesh (which creates a new mesh asset), set collisions (enable overlap events and block all except worlddynamic), and finally add collision shape to that mesh in the static mesh editor.

You can also add a trigger volume or a blocking volume to the brush wall, to generate overlapping events.