How do I make a projectile hit walls?

Hi. I currently have a projectile that is set to collsision OverlapAll. This works fine for collisions with actors but it seems to move through my walls without stopping. How do I rectify this?

Thanks,

Go to Collision > Collision Properties of your projectile and set it to Projectile. OverlapAll overlaps and passes through objects it encounters.

If you read my message, projectile is already set to Overlap All. I dont want it to pass through any objects it encounters.

oops sorry I misread that. Though I dont find Projectile in collision presets. Where is it exactly?

Hmm, it comes with FPS template by default, but nevermind. You can create a custom projectile collision channel in Project Settings > Collision > Preset. Set everything except Physics Body to Block and set Physics Body to Overlap, and that should do.

Nah. Didn’t work. I am using Side Scroller template and in collision presets there is an object type called ‘projectile’ that is not available to my project. I tried duplicating this preset but still no joy. Any further help would be greatly appreciated.

Hey ,

When setting up projectiles, it’s usually a good idea to create a new Object Channel as well as a new Collision Preset. In Project Settings > Collision, create a new Object Channel and name it Projectile. Set its Default Response to Block. Then create a new Preset, also called Projectile. Set CollisionEnabled to No Physics Collision and ObjectType to Projectile (which you just created). You can then make adjustments to how Preset interacts with other object types. In your case, I would leave most settings to Block, set Pawn to Overlap, and set Projectile to Ignore. Depending on your camera setup, you may also want to set Visibility and Camera to Overlap, but you can wait if it’s not causing you any problems.

That should give you a good default setup for your projectile’s collision. You can then make changes to collision settings in your projectile Blueprint to customize it for different circumstances. You should also check your Collision Preset for Pawn to make sure it is set to overlap projectiles rather than block them.

Hope that helps!

1 Like

Yeah that helps but setting up a custom object channel and collision preset with most settings to block, pawn to overlap, and projectile to ignore doesn’t stop projectiles from passing through walls. Any further help would be greatly appreciated.

Thanks,

Would you mind setting up a simple test project in which this problem occurs and uploading it somewhere I can get to? Thanks!

Hey ,

I haven’t heard back from you in a while, so I’m going to mark this resolved for tracking purposes. Let me know if you can set up a test project for me and I can look into issue further. Thanks!

You didn’t specify if your walls are brushes or meshes. If brushes, then that would be problem as brushes do not possess collision; you would need to replace them with meshes or convert them to meshes (which can be done via Details window when a brush is selected.

For sake of another opting answer:


(From UE4 tutorial videos of “TwinStickShooter”). 3 Steps: (Projectile BP; Object (in my case, a Tank); Collision Box for Object).

  1. BP from projectile must be set to be destroyed “on collision” event (crudely marked in ):

  1. Be sure that your object has, in collision tab, marked “OverlapAllDynamics”, and “Generate Overlap Event”

(This wont avoid making player character going through object (Tank), that is why you will add a component “simple collision box” to it)

  1. With object selected, click in “Add component” (green button over tabs) and choose “Collision Box”.
  2. Make sure to scale collision box to contain whole object (my case, tank) and set properties of this collision box to “Generate Overlap Event”(checked), Collision presets to “BlockAll” :

Might not be best solution ever. But solved problem of having projectiles going through tank.