Collider acts as an invisible force field around GameObjects, essential for interactions like collisions and input responses. Integrating with Rigidbody, Colliders allow objects to engage physically with the game world, simulating real-world physics. Various Collider types match different object shapes, enabling precise interaction management. Colliders can be set as triggers for event detection without physical response, offering versatility in gameplay mechanics. Refer to the official Unity Collider documentation for in-depth guidance. Unity's Collider Documentation
Properties
Points to the Rigidbody component associated with the Collider, crucial for physics interactions. Unity's Collider.attachedRigidbody Documentation
Retrieves the Collider's world space bounds, outlining its physical extent. Unity's Collider.bounds Documentation
Adjusts collision detection sensitivity, controlling the threshold for collision recognition. Unity's Collider.contactOffset Documentation
Toggles the Collider's interaction capabilities; disabling prevents collision detection. Unity's Collider.enabled Documentation
Specifies layers to exclude from collision detection, enhancing control over interaction scope. Unity's Collider.excludeLayers Documentation
Indicates the capability to modify collision contacts, useful for custom collision handling. Unity's Collider.hasModifiableContacts Documentation
Defines layers to include in collision detection, allowing targeted interaction setups. Unity's Collider.includeLayers Documentation
Converts the Collider into a Trigger, which notifies of entering or exiting objects without physical collisions. Unity's Collider.isTrigger Documentation
Determines override precedence in Layer Collision Matrix conflicts, guiding collision layer resolution. Unity's Collider.layerOverridePriority Documentation
Identifies if the Collider supplies collision contact data, facilitating detailed interaction analysis. Unity's Collider.providesContacts Documentation
Methods
Determines the nearest point on the Collider to a specified location, useful for proximity-based interactions. Unity's Collider.ClosestPoint Documentation
Identifies the nearest point on the Collider's bounds to a given location, focusing solely on outer limits. Unity's Collider.ClosestPointOnBounds Documentation
Parameters
ray
maxDistance
Updated 12 days ago