Collision not always detected - ThirdPersonCharacter walking on Cube static mesh

Hi,

I am having a problem with collision not always being detected when my ThirdPersonCharacter is walking on a bunch of Cube static meshes and I’m at a loss to understand why.

It is detected some times but not always when walking. It is detected always when you land after jumping and detected always when you walk into the side of the cube.

The cubes float up and down the Z axis by +5 to -5 offset of their original Z based off a looping timeline if that has relevance to the issue (my guess is this is the problem)

I have created a short video of what I mean by ‘Not always detected’ and some drive through of the project setup.

Any help would be appreciated.

Cheers,
Deon.

I believe that what you pointed out (“The cubes float up and down the Z axis by +5 to -5 offset of their original Z”) is indeed the problem! Because your character is walking forward, when it walks off of a cube that is higher than the next cube, it is likely that the collision will skip that cube when the character lands on a third cube, given your character’s speed. I’d guess if you lowered your character’s speed (a lot) you’d get the effect you want. But that’s not very useful, so I’d suggest this:

  • Create a blueprint with that cube mesh, disable the collision on that cube, and create a new collision box, that has the dimension of the cube, but is, say, 30 units taller than the cube. I think that’ll solve your problem!

Let me know if it works :wink:

Hi,

I tried your suggestion and ended up with my character hovering over the cubes. I’ve been watching some more tutorials on collision and have a few other ideas to try. I am not sure if this can be done but it’d be cool if you could have collision on the cube set to block and then have a 2nd collision volume just above the cube set to overlap. I couldn’t see a way to set that up. Other things I’m going to try are some sort of trace if thats a possibility or some collision attached to the character’s feet?

Thanks for the help :slight_smile:

Yes you can do that! In order to do that, you simply have to change the 2nd collision box’s settings, to OverlapAllDynamic, instead of BlockAllDynamic. And change the overlap events to that collision box instead.
Let me know if that works :slight_smile:

I misunderstood your original answer.

Realised after watching another collision tutorial that I wasn’t adding the new collision in the right place :smiley: So in the end I have a cube static mesh with a simple box collision set to BlockAll, in the blue print I have a cube set to BlockAll and then, this is the bit that I did wrong, I added a Box Collision as a child of cube and set that to OverlapAllDynamic.

And now we’re peachy. Thanks again for your help :slight_smile:

Working version here -

Happy to hear :smiley: no problem :wink: