This is my room. It is a static mesh
I want to do collision, really simple. Don’t fall through floor. Don’t walk through walls… For the life of me I cannot find out how to do it.
Obviously none of the standard collision calculations work because the model is concave… So how do I do it?
You can create custom collision geometry in your 3D package. The basic workflow is like this:
Create geometry in your DCC package and name it (e.g. “room”)
Copy the geometry (and simplify it if necessary) and name it “UCX_room” (this allows UE to automatically recognize the collision mesh
Select and export both “room” and “UCX_room” using FBX
Import into UE (Important: Unselect “One Convex Hull Per UCX” or you will not be able to enter the concave areas)
To check it: Double-Click the imported mesh to get into the mesh editor then click the collision icon at the top. It should now show correct collision bounds for your concave model.
Alternatively: Create simple elemens (e.g. floor / wall) and combine them in the editor (is more memory efficient too). This way you can use the default collision geometry generators within UE most of the time.
I’m not sure if it’s the best way to do it in editor but you could try block volumes… normally however you would make a simple collision mesh in 3ds , blender etc.
You can always use the BSP brushes within UE for simple prototyping (I’m doing my level blockouts this way) No need to go to Blender for a setup like the one you’ve shown…
I can’t use the BSP brushes since I am using Instanced Static meshes for performance reasons.
Also, my level is generated randomly, so to make the blueprint perform ok, good collision on the static mesh is pretty much needed instead of generating that on the fly as well.
As for using the Complex collision as simple, I tried it, but it didn’t seem to work, I will try it again just to see what options are there.
But in the end I will use Blender for making my collisions. This is the “right” way to do it and it also gives me the best performance it seems.
If I could do proper modelling I would make 10 different rooms and connectors.
My blueprint is made so that it places the rooms in a grid, and then fill in connectors. So if you have several different rooms and connectors it would look nothing like a grid.
Also, if you made the a connector that would block instead of connect, it would create a much less linear experience.
Alas, I have no modelling skills, so everything is square and boring.
Overview of the blueprint size.
It works with InstancedStaticMesh, so performance is pretty good as the rooms are handled with very few drawcalls.
Once I get some proper rooms with collision going I will add random spawning of props to the rooms, and in the end… enemies.
I have made some new rooms just now. The mesh itself, displays nicely, no problem. But the UCX mesh… for some reason it is HUUUUGE!
It is so big it covers the entire scene, so obviously it doesn’t work.
The bright green and red lines are the collision… What is going on?