Skip to content

Collision Shapes

In order for a physics object to collide with other physics objects, a collider must be defined. Simply put, a collider is the geometry that represents the solid portion of the object - which may or may not match the visible portions of that model.

Unbound lets you create a collider (or “collision shape”) in a few ways: it can auto-generate one based on your model, or you can define it manually. In this article, we’ll cover both—starting with the auto-generated version.

image showing collider mesh on a die in unbound
collider mesh overlayed on model of a die

Collider Shapes

Once a model has been set as a physics object, additional parameters will appear in the Stage and Play modes. In this article, going to focus on the collider shape dropdown and edit collider button.

Note

We'll cover the full set of physics properties in more detail in the article on Physics Properties.

image highlighting the collider shape type and edit collider buttons in unbound

To assign a shape, click on the model then select one of the 3 options from the dropdown; box, capsule, or edits.

showing collision geometry in unbound
collision geometry is visible hovering over the options or the "edit collider" button

Box Shape

The Box Shape wraps your model in a rectangular prism. It fits boxy models exactly, but with rotated or irregular shapes, collisions may occur outside visible geometry — which in games is often preferable.

showing how box shape geometry fits different sdf shapes in unbound

Capsule Shape

Capsule shapes, like boxes, will attempt to encpasulate (pun intended) your model with a capsule shape. Capsules are commonly used in video games as colliders for players and enemies because they're more efficent than 1:1 collision geometry and their rounded ends allow them to slide up stairs or around sharp corners.

capsule collider on a character in unbound

Edits as Colliders

There will be scenarios where you'll want a more precise collider to match the shape of your model which is where using edits as colliders comes in. This option will wrap the collider around the shape of your model.

using edits as colliders in unbound

For comparison, here is the same irregular shape using each of the 3 shape modes:

comparison of auto-generated collider types in unbound

⚠ When using edits as colliders, there are some caveats:

  1. Complex shapes are more "expensive" than simple colliders. This is true in any physics simulation. So use them only where necessary.
  2. At the time of writing, negative edits are treated as volumes. So scenaries like the one below may not result in the expected shape.
showing edge-case collision geometry in unbound
In this example, the cone was made using negative shapes, so the collider doesn’t match the visible geometry exactly.

Editing Colliders

If you want to make adjustments to the source SDF edits/models for your colliders, Unbound includes an edit collider button. This button allows you to adjust your collision model's edits with a live preview of the collider being generated. When you're done making ,adjustments click stop edit to pick up right where you left off.

example showing the edit collider feature of unbound

Manual Shapes

There will be times when you need more precise control over collision shapes. For those situations, we can look at physics inheritance.