Hello,
I have been creating a playable level for a few days now and I’m stuck trying to import it into UE4. I am using Blender to export the level mesh into .FBX form along with UCX_level(which is a duplicate of the level, created so that the engine knows how to create collision). But after importing, the level’s collision isn’t what I expected:
You might say that the design is too complex and that’s causing the UCX collision to spaz out like this but I don’t think so, since the level only has 320 faces:
Check your collision for missing or inverted faces - that usually breaks the collision on import. Also, it seems you have a good amount of concave pieces in your collision, that breaks, too. UCX -> convex, concave is not supported, you have to break down concave pieces into convex ones.
Better practice would be to separate each convex piece into it’s own UCX_level_01 piece, to lift some load off the CPU on collision calculations. More work but it does pay off in the long run.
Exactly.
Think of UCX as it’s kind of cellophane sack. It cannot wrap the hole, because it’s a sack. So you need more separated pieces to cover the frame around the hole.
I am not sure I am reading it right - isn’t it possible to create collisions as convex meshes in 3D app and export it with static model in the same FBX ?
I’m afraid not… At least I didn’t find a way. You can only create it separately.
In case of walls, ceilings and floors where polycount is very low, I would set the collision “per poly”. But create smaller chunks, not the entire level in one fbx. Divide your level objects per lightmap.
So I can’t have my static mesh and UCX_* convex meshes exported in the same FBX and have UE4 automatically recognize collision models by UCX_ prefix ? o.O
How would I set static model to use per-polygon collisions ? Is that screenshot showing how to do that?
Yes, this is static mesh editor. Just double click on static mesh inside of content browser and this window will show up. And yes, complex collision as simple is a per-poly collision.
And unfortunately you can have only one thing at time, I mean or UCXes or per-poly.
What I meant by importing separately, I meant if you wanted to use both UCXes and per poly.
Let’s say you have walls, but on them you have some crazy sci-fi ornaments with cables or something. You should use per poly for walls, and create UCXes for ornaments.
What you can do, and actually what I usually do in 90% of cases, is to compose several pieces in a blueprint.
When you see that creating hundreds of UCXes is too much of a pain in ***, just create the collider mesh in your 3d app, set it as per poly, throw it in blueprint and set it as invisible.
Best example are in fact cables, rounded balustrades of stairs, bowls (like one in third example of my ilustation), etc.
Hmm… So I would have 2 FBX files, one with visual mesh and another one with low poly collisions mesh. Visual mesh will have no collisions, and low poly mesh would have per-poly collisions. Correct?
How do I make it where I drop those two (or more if necessary) static meshes into scene as one piece and can select and move both as one actor ?
Also I am just starting with UE4, so I am total n00b in BP. Is there a tutorial about setting the whole thing up (visual mesh + collisions meshes to be as one, have collision meshes invisible) ?
This is very simple, you just have to create a new blueprint actor. Inside of it you just drag and drop elements from your content browser into the vewport of the blueprint editor window.
There on the left side is components pane, this is where you create hierarchy of the objects, just like you do in 3ds max, maya or other 3d app.
Blueprint actor acts like one thing with all the components inside when you drop it into the level. To put it simply, it’s a container, and can be interactive when you add stuff inside of event graph or construction script (but this is for the whole different topic).
On the right side you will find Details pane where you can set all sorts of things for each element, like visibility, collision, physics, rendering, and much much more.
The beauty of the blueprints is that you can put inside other blueprints. See the image below, it shows drawers and doors that are actually instances of two other blueprints. And they can be opened by the player, because they have in their own event graphs all sorts of functionality:
There are plenty of tutorials on how to create a blueprint, so I’m not going more in detail.
You will see how simple that is once you create a blueprint. You don’t need any extra tutorials for that. If your visible mesh is in the same position as mesh collider, all you need is to add it to hierarchy and set the few checkboxes and you are done. See my last post here: Issue importing UCX collisions - Platform & Builds - Epic Developer Community Forums
You don’t need anything in scripts. Blueprint will act just like a mesh when scripts are empty.
Throw elements into blueprint viewport, or directly in component list. You can change hierarchy to whatever you want, and you can move them, rotate and scale.
Also you can try to copy positions and orientations from your 3d package, if you are compositing a level map with several repeatable pieces (like windows or doors).
I use 3ds max and if I remember correctly y or z axis is negative. But I usually just align pieces manually, not a big deal.
I’ve been doing entire apartment in one blueprint. Then added it to level for more stuff that I cannot put in a blueprint, like reflection probes; lightmass volume or navigation mesh volume etc…
And then I set the apartment level as a sublevel of a building level, hehe. I don’t know if I can make building level as a sublevel of other level, but I will figure it out later.