Skip to main content

Collision

The Collision component assigns a collision volume to the entity. The component interface dynamically displays different attributes based on the 'Type' attribute.

The Collision component can be enabled or disabled using the toggle in the top right of the component panel. If enabled and if the component is a trigger volume (because it has no sibling rigidbody component), the trigger volume will be enabled. Likewise, if the component does have a sibling rigidbody component, the rigidbody will be enabled.

Box

Collision component (Box)

Capsule

Collision component (Capsule)

Compound

Collision component (Compound)

Cone

Collision component (Cone)

Cylinder

Collision component (Cylinder)

Mesh

Collision component (Mesh)

Sphere

Collision component (Sphere)

If the entity also has a rigidbody component, the collision component determines the shape of the rigid body. If no rigidbody component is present, the collision component is treated as a trigger volume. The trigger volume cannot affect the simulation of other rigid bodies in the scene. Instead, you can add a script component and attach a script which responds to trigger events. For example, if another entity that has a rigidbody component enters or exits the trigger, your script can be notified.

Properties

PropertyDescription
TypeThe type of collision primitive. Can be:
  • Box
  • Sphere
  • Capsule
  • Mesh
Half ExtentsBox only. The half-extents of the collision box. This is a 3-dimensional vector: local space half-width, half-height, and half-depth.
AxisCapsule only. Aligns the capsule with the local-space X, Y or Z axis of the entity.
HeightCapsule only. The tip-to-tip height of the capsule.
RadiusSphere and Capsule only. The radius of the sphere or capsule body.
AssetMesh only. The render asset or model asset that will be used as a source for the triangle-based collision mesh.

Scripting Interface

You can control a Collision component's properties using a script component. The Collision component's scripting interface is here.