Create colliders in Blender
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.
To set up your colliders:
- Create a parent empty object: In the Outliner, add an empty object to serve as the parent for both the geometry and the collider.
- Add geometry as children: Place all your geometry meshes as children of the parent empty object.
- 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:
In this example:
- Parent is the empty object.
- Collider is the object representing the collision bounds.
- Geometry is the 3D model.
To define the collider and rigid body properties, follow these steps:
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.
Assign a String type to your parent empty object from the property settings.
How to add custom properties:
Select the object and go to the Properties editor tab.
Scroll down to Custom Properties and click Add.
Click the Edit button (gear icon) next to the new property.
Enter the property name and value, then click OK.
For more information, visit Blender's Custom Properties guide.
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.
Assign a String type to your collider object from the property settings.
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.
For more information, consult the following help resources: