Bug on Custom Collision

I exported an L-Shape mesh from 3DS Max. I used custom shape for collision. They are both from the same FBX file and UE imported successfully as you can see in the screen shots.

However, when I played the game and moved the objects around against each other, the collision did not work as expected. I turned on the “sweep” option when changing locations and set their collision property to “BlockAll” but have no effect. The bottom part of the L-Shape overlap with the other object and got stuck.

This is a bug. Any workaround?

Hi Pelangi,

This does not seem like a bug, This just looks like you need to increase your boxes collision so that it covers the mesh itself because your collision boxes are smaller than the static mesh.

Couple of alternatives: If you’ve setup more complex collision in your modeling program when you import you can uncheck the option for “one convex hull per UCX” and this will allow multiple hulls to be generated to create more accurate collision mesh. This can be a hit on performance though because you’re mesh could end up with a very high number of collision hulls that aren’t necessarily needed when you can get away with fewer.

If you’re mesh is going to be static and not movable you can use the Static mesh Details Panel > Collision Complexity > set it to use “complex as simple collision”. This will enable per poly collision using the mesh as it’s own collision, so long as it is static.

Lastly, when 4.8 releases we’ll have better auto-convex collision generation. You can do this in the static mesh editor by going to Menu > Collision > Auto Convex Collision. You can adjust the slider to get more accurate collision generation.

I’ve also got a post on the forums that walks through the steps of creating custom collision from beginning to end in 3Ds Max here that may also help: [TUTORIALS] Photons Be Free: Mini-tutorials and other curiosities - Community & Industry Discussion - Epic Developer Community Forums

I hope this helps.

Tim

Thank you Tim for your response. However, it seems that you didn’t try it yourself and made premature conclusion. Please see my screenshots. I added comments in them so you can see that it’s a bug.

When I move the L-shape box to the left (with sweep enabled), it does not collide with the box on the left. That small box also have a simple collision box and collision property set to “block all”.

I also tried to add more collision box in the mesh, but the result is the same. So how does a simple L-shape object cannot have a simple collision?
If I used auto-generate collision during mesh import, then it does not generate the desired collision shape.

Dynamic objects cannot use collision complexity “complex as simple (per-poly) collision.” This is too expensive to be used for dynamic objects.

This is where custom collision needs to be used and my tutorial sets this up. It’s using multiple collision boxes to get a more defined shape. You can even do this in the editor by just using multiple simple box collision shapes.

Using the auto-generated collision will not give the best results without increasing the hull and vert count which can produce more hulls than necessary.

The “Block All” is a Collision Channel and not specifically collision itself. The collision needs to be properly setup on your static mesh. Even then, depending on how you’re moving an object in BP can determine how collision works as well. For instance, if you setup a timeline to move your object and are moving your object, collision will not be used. You need to setup ray casts that will detect when a hit has occurred to stop your object. using the VInterpTo with a timeline to set the actor location is a good example of this.

Hi Tim, I’m interested in your statement:

This is where custom collision needs to be used and my tutorial sets this up. It’s using multiple collision boxes to get a more defined shape. You can even do this in the editor by just using multiple simple box collision shapes.

Where can I find this tutorial?

If I use multiple collision shapes, then I’ll have to move them one by one in my BP right?

I think I understand now. Custom collision won’t work on meshes that can be moved by the player. In other words, that mesh will not stop upon collision with other meshes, when it is moved using AddWorldLocation, AddRelativeLocation, SetWorldLocation, or SetRelativeLocation, even though all of their collision properties are set to “BlockAll”. It can only trigger overlap events.

So for this case, only one of the default basic collision shape (box, sphere, capsule) can be used.

Your tutorial is great and I assume that the mesh you used is not intended to be moved by the player. Correct?

Otherwise, the “BlockAll” option won’t work either.

I linked the tutorial in my original answer: [TUTORIALS] Photons Be Free: Mini-tutorials and other curiosities - Community & Industry Discussion - Epic Developer Community Forums

Each UCX will need the UCX tag, name of the mesh, and a reference number (ie. UCX_[MeshName]01, UCX[MeshName]_02)

I’m not sure what you mean by havingto move multiple collision shapes in your BP. That really doesn’t have anything to do with it as far as I’m aware, unless you’re doing something that is outside the realm of what works with Physics. If you’re moving objects by telling it to move to a location it’s ignoring collision which I would expect unless the logic has been put in place to tell the object not to move if it comes in content with another piece of geometry.

With this method in my tutorial it’s just showing you how to setup multiple collision boxes for a single static mesh and import them. This would be no different than doing this manually in the Static Mesh Editor and placing two collision boxes for your L shaped mesh.

Yes, that would be right. using BPs to move negates the use of collision unless there is physic involved. Since the nodes you’ve mentioned are just change the location of a mesh physics is not needed because it’s not simulating and there isn’t another movable physics actor that is there to collide with the object.

Meshes I used are not meant for setting the location of the object for use like you’ve intended. For instance, the collision meshes that are used with those are intended to be used when an object is simulating physics, or if the a playable character or movable object needs to react to an object in the world by interacting with it’s collision mesh.

Using BPs to move the mesh it would be best to use a trace or logic of some sort that detects when another meshes distance is detected and determine what needs to be done from there. The blockall option is using the collision mesh of the static mesh, which isn’t used directly when using the nodes you’ve mentioned above.

I did find this on the forums, which may be useful. There is a user that has setup a bunch of 2d and simple games that use logic to move things around the scene that are not using physics collisions. I’ve not tested any of these really, but they look promising and may be helpful in what you’re trying to accomplish.

Thank you so much!