Problem with Road Mesh Collision if used with Spline Mesh

Hi, i made a simple setup for a road spline in Unreal Engine 5.3. Everything works fine except for one thing. The collision of the mesh gets disabled if the spline mesh is near another surface with collision (does not matter if its a terrain or a different static mesh).
Here are some screenshots to illustrate the problem:

The static mesh for the road piece has collision and if used as a standalone mesh everything works out:

This the construction kit i use to spawn the different road pieces:

Is there something else to do with the static meshes that are being used for a spline mesh?

What does the mesh collision look like? (Of the original mesh)
Does it even have a visual debug?

Generally, it won’t work with sheets or complex as simple.

@MostHost_LA The collision of the orignal mesh looks like this:

  • Complex collision:

  • Simple Collision:

And yes i have “Use Complex Collision As Simple” selected.

Regarding “it won’t work with sheets”, so it is generally better to have a closed mesh if working with a spline, if i interpret this correctly?

My next try would be to create custom collision in blender and re-import the mesh.

Update: I have now tried to make a custom collision in blender.
In Blender it looks like this:

And is Prefixed “UCX_” and in the asset browser it looks like this:

When i look in the editor with “Player collision” as view mode i get this result:

On the right barely the static mesh version of the road piece and one the spline the left.

Update #2: For testing purposes i have now created a very simple closed mesh.

But with this it still occurs as soon as the spline gets closer to another static mesh with collision:

As soon as a certain distance between the spline and the static mesh is given the collision starts working:

Collision generally works best with convex shapes.
Collision that’s as complex as your mesh with hundreds of triangles, will use a lot more CPU than typical convex decomposition hulls (or plain boxes.)
A spline will deform the mesh, so even if it looks convex in Blender, it might become non-convex and invalid when bent/deformed.

Recommendation: Define simple collisions. Use a simple box for that if possible.

@jwatte I have now followed your tip and created a very simple mesh with a simple collision box. But somehow the error still occurs depending on how far the spline is away from other static meshes with collision on them. These is my testfile:

SplineTest.rar (97.7 KB)

Is this maybe a bug in 5.3? Is it important for the construction script at which position of the graph i enable the collision for the spline?

Very possible it is an engine bug.

However, if you see triangles like in the screenshot, then the collision is not a “box”
(Ans this too could be an engine bug).

To have the street mesh bend around and provide collision you should make up the collision of the same amount of boxes as the mesh has subdivisions in the forwad axis (direction of travel?)

My regular road tiles are 10m long with 1m sections.
Each of those sections has a box collision or a UCX/UBX.

Whenever possible, dont use spline for it. Because with spline you cannot instance stuff.

A good road is made up of instanced parts, and has turns/twists you would otherwise need custom models for set to the spline instance.

Are you still using “Use Complex Collision As Simple” ?
That doesn’t work for splines if I recall correctly.
You need to mark up the static mesh with a simple box collision in the unreal mesh import/editor because a “box collision” is different from a “mesh collision that happens to look like a box.”
There might also be a way to make Blender generate the appropriate mark-up in the output export file, such that the engine generates this simple collision primitive automatically, but I haven’t looked at this for the last 10 years or so, so check the art path documentation …

I do splines with simple collision all the time. It’s a bit of extra work, but I break up the collision into a bunch of boxes in my 3d modeling program before importing and UE will deform those with the splines.

Labeling collider meshes as UBX_meshname.istnacenumber

Usually does the trick.

And the docs to follow for naming/etc.

Ofc, I use my own custom FBX exporter, which I did modify to allow proper exports.
I honestly do not recall if the default exporter considers the naming that way or not.

But anyone can likely watch a blender tutorial on it. Surely there’s plenty…

1 Like

@jwatte I have now tried all the collision setups, but yes “Use Complex Collision As Simple” was my default setup. But changing it did not change anything.

@MostHost_LA @ZacD I tried with UCX_ and UBX_ (according to the docs) and it got imported correctly in each case:

And as long as it is used as a static mesh it works perfect. As soon as it gets used with a spline the bug appears under specific curcuimstances.

SplineTest_2.blend (983.9 KB)

It really looks like that it has something todo with being close to another surface with collision. I made now additional tests where i place static meshes with collision close to spline mesh, as soon as it gets close to the spline, the collision does not work for that small part anymore:

Still working:

Stops working:

And it only stops working for specific part that is above the object, the rest of the spline is perfectly working.

Ok… does the visual collision reflect this?
Yes = engine bug
No = maybe something is up with the character movement?

Given I have never seen this happening I’m leaning towards engine bug…

@MostHost_LA If you mean the “player collision” view, it does not reflect that at all:

Problematic distance:
Screenshot 2024-01-25 173513

Non-Problematic distance:
Screenshot 2024-01-25 173524

If you mean the “show COLLISION” during runtime, it also does not reflect it:

Problematic distance:

Non-Problematic distance:

For this tests i played around with the collisions settings of the meshes and it never changes the outcome.

Yea but you can clearly see here that the issue is bad foot IK, not the collision.
Character capsule is where it ought to be, so it isnt an engine bug.

Disable the IK and it will be back to normal.

@MostHost_LA Thanks for the help, with the IK deactivated it now works:

Sorry, if this was a stupid question but i would have never thought about the IK of Quinn as the source of the problem.

Not stupid at all!

And the reason it was worse with complex as simple is that collision was too thin.

As the collision became thicker the issue started occurring less.
Thats what made me think it had to be character movement related - the visual of the collision was really just the confirmation.

Glad you sorted it.
You can likely improve on the IK so that it doesnt overshoot collision (assuming you made it, if thats part of the engine now, well then you need to file a bug report on it?)

The one in the screenshots is the default UE5 Mannequinn. I always use it for prototyping something.

If you havent touched the IK/settings, I would suggest filing a report for this.
Its a bug with calculations that should not be happening in the “default” setup.

I will report a bug, because i did not change any setting on the character or its IK at all.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.