4.5: Collision event hit issue with simulate physics and CCD

In Refunktion you can throw a small cube. This cube has simulate physics on. If the cube hits something after being thrown it emits a tone.

In an old version of the game the cube used to fall through BSP sometimes with low FPS. So I set the cube to use CCD (continuous collision detection). After that it never fell through BSP ever again however now it can happen that it sometimes no longer emits a tone. This happens due to Event Hit event not being called in some cases with simulate physics+CCD on BSP.

The interesting part here is that it never happens in PIE but is only reproducible in the built game (debug or shipping).

Version: 4.4 and 4.5 (didn’t test earlier versions)

You can see a video of it happening below. There in the blueprint I print a message immediately after Event Hit event so you can see that Event Hit event does not get called for the first 2 collisions.

Hi dgrieshofer,

Where are you setting the IsThrown variable? If you watch this value while playing is it registering as true or false on hit?

Hey TJ, you can safely ignore this variable. The main thing to watch out for is that the message does not even get sent on the first two collisions - in this case - (so it does not matter if it is true or false) because the event does not get triggered as you can see in the video. I could replace everything with just a “Hello” print string and it also would not be sent.

I’ve been testing this and I haven’t been able to get your results. Could you post a screenshot of your entire event graph?

Also, does this only happen when the cube is thrown against BSP’s or does it happen with any object?

Hi dgrieshofer,

We haven’t heard back from you in a few days, so we are marking this post as Resolved for tracking purposes. If you’re still experiencing this issue, please feel free to post back here with additional information.

Thanks,

TJ

if your level is made of BSPs, you will need to convert them into static meshes if you want them to have hit events.

if you want it to work on any surface the cube can bounce off of, instead of triggering the tone on hit, you could trigger the tone whenever you detect a sudden change in velocity.

Hit events generally work with BSP but there seem to be random occurances with small objects/CCD/simulated physics where it just doesn’t work. And using tick for something like that is kinda hacky but thanks for your input:)

Sorry but the reason for the delay is that it is very hard to make it reproducible and I have already spent a lot of hours on it. So far I have removed every piece of blueprint logic from the thrown object itself except for printing a message on hit event but the issue still occurs. This only happens on some parts of BSP. The strange thing is that the collision itself works but only the hit event doesn’t get triggered. Seems like BSP collision is currently a bit unreliable and I might need to replace them all with static meshes which will be a lot of work though.

I believe Omnicypher is correct, the best solution is to use static meshes in place of them.

What you are doing should ‘ideally’ work with BSP, but they are sometimes limited and will have undesired effects in packaged games. The intent for BSP are to block out levels and then be replaced by or convert into static meshes.