Thursday, August 7, 2014

Creating Custom Collision for Unreal Engine 4 in Blender

After you have gone through the steps of readying your mesh to export into Unreal, you may want to consider adding your own collision to your model. Collision, put simply, is what tells your game what parts of your mesh objects can and can't pass through. UE4's collision tools are great, they have even updated the collision creation tool to work with more complex geometry to allow objects to pass through holes in the mesh, but if you want more control over how your collision works, it can be easily done in Blender.

Here are the steps to create custom collision in Blender for use in UE4.

1. Start by making note of the name of your object.

2. In Object Mode, add a cube (Shift+A), select your newly made cube, switch to edit mode (Tab Key) and edit the cube so that it has slightly larger dimensions than your mesh. This will be your collision mesh. Name your collision mesh using the "UCX_objectname" naming convention.

3. Back in Object mode, select both your mesh and collision mesh (Hold Shift + Click). 

4.With both meshes selected, export your mesh as an FBX file, and you're done.

In Unreal, you can check to make sure your collision applied correctly by opening up your mesh in the editor and selecting "View > Collision" or by pressing the "Collision" button on the toolbar. The collision outline is shown in green below.

Things to Note: 

  • Objects would not be able to pass through the spaces in the example mesh using this collision setup. 
  • Collision for acute angles in your mesh should be comprised of multiple separate shapes (unless you want collision in between these areas). Just name the extra meshes sequentially using this format: "UCX_[MeshName]_[Number]"
  • It's also OK for your collision meshes to overlap each other.

No comments:

Post a Comment