[Tutorial]Importing static FBX's with complex collision

+
One thing you'll immediately notice if you've ever tried importing static meshes into Redkit is the engine is very fussy about collision. For example. Here's a static mesh of a wall I created.

QgrKO9S.png

This is the generated collision mesh. Redkit by default generates a basic collision mesh. This is okay if it's something simple like a wall or a pillar. But if you want to make anything even slightly complex it doesn't work. Like here Geralt stands floating on-top of the mesh.
JKiSERx.png

Thankfully there's a surprisingly simple way to fix this. Just create a collision mesh in Blender and name it "NAME_col". However there's one issue with this. Redkit is fussy over what collision it accepts. In my experience it refuses to import anything more complex than a cube. Even multiple cubes joined together it hates it.

There is a simple fix for this. Just create multiple collision meshes. All with the suffix "_col"
S3PXlia.png


image (1).png

You can very easily reimport by going to Reimport->Collision only

8E6JzgJ.png


image (2).png

And they should now work.

image.png

Now Geralt is correctly standing in-between the two walls instead of floating on-top of the mesh. Hopefully this helps you out.



---------------------------------------------​


There's been another discovery thanks to Witcher discord user mikneim. You can also name collision _tri to import a triangulated mesh. Make sure you add the triangulate modifier to the collision mesh for this to work.

Screenshot 2024-05-06 043315.png

This also appears to work. According to Witcher discord member erx it has a hard cap of 65536 vertices. It is also the worst in terms of performance so ideally it should be used selectively.

image.png

These are his complete notes on the subject.

Code:
- _tri and _coll named meshes generate collision cache
  - _tri concave (bowl)
  - _coll convex (sphere)
- _tri named meshes must be triangulated prior export (add modifier)
  - otherwise wcc error
- CMeshComponent does NOT generate collision cache
  -> CStaticMeshComponent required for collision generation

o blender export
  Open the .fbx export options and load the default ones:
  - uncheck the "Add Leaf Bones" option.
  - change Path Mode from "Auto" to "Copy" and check the "Embedded Textures" options.
  -> Export the file.

  - import .fbx to .w2ent: .xml file containig material settings in same directory as the .fbx
 
Last edited:
Top Bottom