Version: 2023.2
Language : English
Physics Debug window reference
Capsule Collider component reference

Box Collider component reference

Switch to Scripting

The Box Collider is a basic cuboid-shaped collisionA collision occurs when the physics engine detects that the colliders of two GameObjects make contact or overlap, when at least one has a Rigidbody component and is in motion. More info
See in Glossary
primitive.

Properties

Property: Function:
Is Trigger If enabled, this ColliderAn invisible shape that is used to handle physical collisions for an object. A collider doesn’t need to be exactly the same shape as the object’s mesh - a rough approximation is often more efficient and indistinguishable in gameplay. More info
See in Glossary
is used for triggering events, and is ignored by the physics engineA system that simulates aspects of physical systems so that objects can accelerate correctly and be affected by collisions, gravity and other forces. More info
See in Glossary
.
MaterialAn asset that defines how a surface should be rendered. More info
See in Glossary
Reference to the Physics Material that determines how this Collider interacts with others.
Center The position of the Collider in the object’s local space.
Size The size of the Collider in the X, Y, Z directions.

Details

Box Colliders are rectangular cuboids and are useful for items such as crates or chests. However, you can use a thin box as a floor, wall or ramp. The Box Collider is also a useful element in a Compound Collider.

To edit the box’s shape, press the Edit Collider button in the InspectorA Unity window that displays information about the currently selected GameObject, asset or project settings, allowing you to inspect and edit the values. More info
See in Glossary
. To exit the Collider Edit Mode press the Edit Collider button again. A vertex appears in the center of each face of the Box Collider in Edit Mode. To move the vertices, drag them when the mouse is over the vertex to make the Box Collider bigger and smaller.

BoxCollider

Physics Debug window reference
Capsule Collider component reference
Copyright © 2023 Unity Technologies
优美缔软件(上海)有限公司 版权所有
"Unity"、Unity 徽标及其他 Unity 商标是 Unity Technologies 或其附属机构在美国及其他地区的商标或注册商标。其他名称或品牌是其各自所有者的商标。
公安部备案号:
31010902002961