Blender guides

Create colliders in Blender

8min

Colliders define the physical boundaries of objects, allowing realistic interactions within the iR Engine. You can use Blender's custom properties to embed custom iR Engine data directly into the scene graph.

Set up your scene hierarchy

To set up your colliders:

  1. Create a parent empty object: In the Outliner, add an empty object to serve as the parent for both the geometry and the collider.
  2. Add geometry as children: Place all your geometry meshes as children of the parent empty object.
  3. Add a collider object: Create a collider object (e.g., a cube for a box collider) and make it a child of the parent empty object.

The scene hierarchy should look like this:

Document image


In this example:

  • Parent is the empty object.
  • Collider is the object representing the collision bounds.
  • Geometry is the 3D model.

Add custom properties

To define the collider and rigid body properties, follow these steps:

Step 1. Define the rigid body on the empty parent

1

Select the parent empty object and add the following custom properties:

  • xrengine.EE_rigidbody.type: Define the rigid body type. Set this to fixed for a static rigid body.
  • xrengine.entity: Define the base entity for the rigid body. Assign a name like Parent.
Document image

2

Assign a String type to your parent empty object from the property settings.

Document image


How to add custom properties:

1

Select the object and go to the Properties editor tab.

2

Scroll down to Custom Properties and click Add.

Document image

3

Click the Edit button (gear icon) next to the new property.

4

Enter the property name and value, then click OK.

For more information, visit Blender's Custom Properties guide.

Step 2. Define the collider on the collider object

1

Select the collider object and add the following custom properties:

  • xrengine.EE_collider.shape: Define the collider shape. Options include box, sphere, mesh, or cylinder. For a box collider, set this to box.
  • xrengine.entity: Assign a name for the collider entity, such as Collider.
Document image

2

Assign a String type to your collider object from the property settings.

Export your file and load it into the engine

Once you have set the custom properties, export your Blender file. After you load the asset into the iR Engine, the engine will automatically recognize the rigid body and collider setup.

Help resources

For more information, consult the following help resources:

Video: How to create colliders in Blender