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:
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:
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…
@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:
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:
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.
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?)
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.