Capsule Collider
Colliders play a crucial role in creating interactive AR experiences by defining the physical boundaries and properties of objects within the scene. The Capsule Collider is a collider component that defines a cylindrical volume with hemispherical ends. It is well-suited for representing objects of cylindrical shapes.
Add a Collider Component
In the Hierarchy panel, select a 3D object and locate its components in the Inspector panel.
Click + Add component, go to 3D Physics, and then select your Capsule Collider.
Properties
The following parameters can be adjusted for a Capsule Collider.
Property | Description |
---|---|
Radius | The radius of the capsule collider, relative to the origin of the game object. Modifying this parameter lets you control the width of the cylindrical portion of the collider. |
Height | The height of the capsule collider, relative to the origin of the game object. By adjusting this parameter, you can change the length of the cylindrical portion of the collider. |
Offset | This determines the position of the center of the capsule collider relative to the origin of the game object. Adjusting the offset allows you to position the collider as desired. |
Rotation | The rotation of the capsule collider in local space |
Physics Matter | Defines the physical properties of a rigid body, such as its friction and bounciness. |
Is Tangible | Determines whether the collider is a trigger or a solid collider. If true, the collider will not physically affect other colliders, but will still generate trigger events when another collider enters or exits its bounds. If false, the collider will physically interact with other colliders, blocking their movement and generating collisions. Defaults to true. |
Show Collider | Enabling this option allows the capsule collider to become visible in the scene view, making it easier to visualize and adjust its position and size during the editing process. |
Use Colliders with a Rigid Body Component
In the physical world, objects require both colliders and rigid bodies to interact with one another realistically. Colliders define the shape and boundaries of objects, while rigid bodies provide the mass, velocity, and other physical properties necessary for realistic physics simulations.
By attaching a Collider component to a game object, you define its physical shape and characteristics. When a Rigid Body component is added to the same object, it enables the object to respond to physical forces like gravity, collisions, and interactions with other objects in the scene.
The combination of Collider and Rigid Body components allows for the creation of dynamic and interactive AR experiences in TikTok Effect House. By defining the appropriate Collider and configuring Rigid Body properties such as mass, drag, and constraints, you can achieve realistic object behavior and interactions within the AR environment.