Bouncing projectiles have no collision

Try having simulate physics Off, change collision type to block all, and simulation generate hit Events on. In the enent graph, make a hit event that adds impulse at location

My projectiles ignore walls and floors (both BSP and meshes) but I want them to collide with those so that they can bounce off of them.

Some things I tried (may differ from screenshots):

  • Simulate physics: unchecked
  • Generate overlap/hit events: checked (this should not be required though but just in case)
  • Tried with BSP and Mesh.
  • Checking “simulate physics” will cause the projectiles to fall flat to the floor, but it does NOT go through the floor. It actually collides with the floor but this behavior is obviously not very useful for a projectile.
  • I made the Mesh a child of the collision component (should not be required but some people say it is).
  • I tried using a custom Projectile “Profile Preset” and “Object Type” but didn’t work either (same result obviously).
  • There is no code in the blueprint that affects collision. Only an event that implements the OnComponentBeginOverlap.
  • Tried various collision presets but none worked.
  • Projectiles DO COLLIDE with enemies and players and also generate OnOverlapEvents. Just not with BSP and static meshes.
  • I checked the default starter FPS Projectile but couldn’t find any difference with my projectile.
  • I tried setting the CollisionSphere to “BlockAll”, I checked the “Block All” collision profile and made sure it actually does block everything. Still does not work
  • I rebuild the level
  • Added more collision boxes and spheres to this projectile and set them to “Block All”.
  • I am out of ideas…

My settings (click links at bottom of post to enlarge):

I created a quick custom mesh and added a HUGE floor collision box. But projectiles still go through it:

I did all that (for both the mesh and the SphereCollision). I also added the impuls (but it never fires). The onhit-event is never fired not even when the projectile is in the middle of a wall-collision. I may have coded the impulse wrong I think but nonetheless it doesn’t even fire.

87504-bp3.png

In the picture it says block all dynamix, change the collision sphere to Block All. And the mesh to no collision. The mesh is just there to look pretty.

Yes and I did as you wrote me (I changed it to block-all). Still doesn’t work. I even added more collisionboxes and spheres and set them to block-all and checked “generate on hit events” but they go straight through everything except for other pawns… Which is weird. And generate no onhit-events which is also weird.

I’m getting this feeling that something somwhere is overriding something to make it only collide with pawns and with nothing else. But when I add a printstring to the “Get Collision Profile” it prints “BlockAll” during runtime so the profile is set correctly and not overriden anywhere. Still it only collides with pawns. So I checked the “Block All” profile but it is setup correctly (blocks all).

So basically I have a projectile (inherits from actor) with multiple collision-components that all are set to block-all and “generate hitevents” checked. And yet they go straight through meshes (with collision) and BSP w/o firing any onhit events nothing. How is this even possible?

Yes I hit compile+save after making any changes. Yes I did rebuild the level just in case.

I also tried a new ‘projectile’:

  • Created new blueprint derived from Actor
  • Added a ProjectileMovement component
  • Set the initial ProjectileMovement speed to 100
  • Added a cube so I can see it in the world
  • Added a collisionbox and set it to “Block All” and check “generate hit events”
  • Drag the cube into hhe level in front of the playerspawn

I run the game and I see the cube falling through the level straight away…

Could it be that the ProjectileMovement component is making the projectile move regardless of collisions? But it still wouldn’t explain why onhit and overlap events are not firing.

After some more Googling around for this “on simulate physics” checkbox (note that both questions did not get answers with a solution other than workarounds):

It seems that the moment you do not simulate physics, ALL forms collision detection will break/cease to exist other than pawns. Is this a bug?

I managed to somewhat get it to work by checking “simulate physics” and unchecking “enable gravity” but this MUST be performed on the MESH component. Which is silly because the collisionboxes themselves still do not work, only the mesh can. And the mesh is supposed to be a visual only normally.

I also took the FPS project (with a working bouncing ball) and copied it’s mesh, projectilemovement and collisionsphere into a new actor-blueprint. So now I’m 100% sure I got it all setup right. Still it falls through the floor. So it’s not the settings in the detail panels the difference has got to be somewhere else.

Also I noticed that the FPS project has no SceneRoot component in the projectile. But I can not delete mine. I assume that the default project was upgraded from an older UE4 version that allowed not having scene-roots.

I copied the “FirstPersonProjectile.uasset” from the FPS sample into my project and rebuild it into my new BaseProjectile. I still have absolutely no idea why that one works and mine doesn’t since I can’t find any difference between the two blueprints aside from having a SceneRoot component (which I can’t even delete).

I would still like to know though what I and all those other people did wrong. Because not one of these posts I could find anywhere on Google had an actual answer other than some silly workaround. Meaning nobody knows?

Secondly: Why does unchecking “simulate physics” also prevent collision-checks including overlaps? Intended?

I found the problem! Might be a UE4 bug. Apparently the moment I ctrl+x the SphereComponent from the FirstPersonProjectile and paste it back (this creates a scene-root so the sphere collision component is no longer the root) breaks it entirely. Only applies to actors that have the “simulate physics everywhere unchecked”. So the CollisionComponent MUST BE THE ROOT in the actor-blueprint and when not, ALL COLLISION (except collisions with pawns for some reason) is gonna be ignored by the game for this object. I reproduced it across several projects. If Scene_Root is the root (which is default) it will break.

Sadly you can’t override the Scene_Root in a child-component… Man this whole thing is so weird I dunno why they implemented the Editor to work this way. So you gotta put in a dummy-component instead of the default-root, then replace it in the child in the constructor with the real thing. Only then can you replace it…

Note that adding additional collision-components does NOT work (only the root-collision-component works).

Because of this insanely weird behavior my guess is that this is a bug.

Yup, what you described after “I found the problem” was the only thing that worked for me too. I added a collision sphere, and dragged it over the scene_root, which replaced it and then it started working.

When actor have DefaultSceneRoot you need to “Set Updated Component” in ConstructionScript. By doing this “Projectile Movement Component” will update the “Collision Component” other than DefaultSceneRoot ,then Collision will work!

1 Like

this solution actually works.

thank you so much for this answer, i was struggling a lot