Using the Collider Component
In this tutorial, we are going to explain the collider components and how to use them with the mesh component and the rigidbody component. The colldier components provide simple collision shapes for your entities. I would also recommend seeing the Entity Components - Components Panel documentation to understand or look up what the specific attributes do.
This tutorial will use the mesh component and the rigidbody component, so if you don't know what they do please see the Rigidbody Component and Mesh Component tutorials first. We will focus on changing the collision of your entity and explain how to create more complex collision shapes.
To get started with the collider components we need to add a rigidbody component and a mesh component first. So create an entity and add those two components to it, select any geometry you want to have. In this case, we are going to take the cylinder mesh and are working in the Rolling Ball template.
Create an entity and add a rigidbody and a mesh component to it and select some geometry.
As you might already know from the rigidbody tutorial, the mesh component is our geometry and collision at the same time. You can enable a debug feature to see all the collider in your level. To do so click on the display button in the upper left corner of your perspective view port, this enables a context menu where you can adjust all kind of display attributes for your view port. Scroll to the bottom and select the "Show Physics Proxies" checkbox. Now you should be able to see all collider in your scene.
Activating the debug physic proxies
As we can see our mesh is also our collider. Sometimes you maybe don't have a mesh or you want to have a specific collider and that's where the collider component can help. Select your entity and go to the properties panel and click on the "Add Component" button to add any collider component you want.
Adding any collider component.
Now you can see that the collider of the entity changed to whatever collider you selected, in my case I choose the box collider. The collider component exposes several properties to specify the physical behavior of it. You can change the mass and surface type of the object and also register this collider to send events to C++ or Schematyc, if a collision happened. Play around with the attributes and see how the entity behaves.
An entity can have multiple colliders, so we can add another one to the entity and change the "Transformation" attribute of the collider component to rotate it or move it around. The position of the component is relative to the entity's origin.
Adding multiple collider and change the transformation.
As you can see in the picture I added a new cylinder component and adjusted the transformation, radius, height of the collider to create a more complex shape. You can add as many colliders as you want to and create whatever shape you need. If you now jump into game mode and disable the physic proxies helper, you can see that your mesh didn't change but the collision did.