The Capsule Collider 2D is a Collider that interacts with the 2D physics system. The capsule shape has no vertex corners and has a continuous round circumference. This shape allows the Capsule Collider 2D to not get easily caught in the corners of other Colliders.
Note: The capsule shape of the Collider is considered solid and not hollow, which means any other Collider 2Ds that are inside the Capsule Collider 2D are considered to be in contact with the Collider and are forced out of it over time.
프로퍼티 | 기능 | |
---|---|---|
Material | Select the Physics Material 2D that determines properties of collisions, such as friction and bounce. | |
Is Trigger | Enable this if you want this Collider 2D to behave as a trigger. The physics system ignores this Collider when this is enabled. | |
Used by Effector | Enable this if you want the Collider 2D to be used by an attached Effector 2D. | |
Offset | 콜라이더 2D 지오메트리의 로컬 오프셋 값을 설정합니다. | |
Size | Set the x and y values to define the size of the box region that the Capsule Collider 2D fills. Refer to Defining Size and Direction for more details. | |
Direction | Select the orientation of the Capsule Collider 2D. This determines the position and orientation of the curved ends of the Collider shape. Refer to Defining Size and Direction for more details. | |
Vertical | Select this to orient the ends of the Collider shape upwards and downwards. | |
Horizontal | Select this to orient the ends of the Collider shape left and right. | |
Layer Overrides | Expand for the Layer override settings. | |
Layer Override Priority | Assign the decision priority that this Collider2D uses when resolving conflicting decisions on whether a contact between itself and another Collision2D should happen or not. Refer to its API page for more information. | |
Include Layers | Select the additional Layers that this Collider 2D should include when deciding if a contact with another Collider2D should happen or not. Refer to its API documentation for more information. | |
Exclude Layers | Select the additional Layers that this Collider 2D should exclude when deciding if a contact with another Collider2D should happen or not. Refer to its API documentation for more information. | |
Force Send Layers | Select the Layers that this Collider 2D is allowed to send forces to during a Collision contact with another Collider2D. Refer to its API documentation for more information. | |
Force Receive Layers | Select the Layers that this Collider 2D can receive forces from during a Collision contact with another Collider2D. Refer to its API documentation for more information. | |
Contract Capture Layers | Select the Layers of other Collider 2D, involved in contacts with this Collider2D, that will be captured. Refer to its API documentation for more information. | |
Callback Layers | Select the Layers that this Collider 2D, during a contact with another Collider2D, will report collision or trigger callbacks for. Refer to its API documentation for more information. |
The settings that define the shape of the Capsule Collider 2D are Size and Direction. Both the Size and Direction properties refer to X and Y (horizontal and vertical, respectively) in the local space of the Capsule Collider 2D, and not in world space.
캡슐 콜라이더 2D를 설정하는 일반적인 방법은 Size와 Direction이 일치하도록 설정하는 것입니다. 예를 들어, 캡슐 콜라이더 2D의 Direction이 Vertical, X의 Size가 0.5이고, Y의 Size가 1일 경우, 수직 방향 캡슐은 폭이 넓어지기 보다는 높이가 커집니다.
아래의 예제처럼 X와 Y는 노란색 선으로 나타납니다.
다른 설정을 이용하여 캡슐 콜라이더 2D를 변경할 수 있습니다. 예제는 다음과 같습니다.
Size 프로퍼티의 X와 Y가 동일할 경우, 캡슐 콜라이더 2D는 항상 원 모양에 가깝다는 것을 참조하십시오.
참고: 2D 물리 시스템에서 한 가지 알려진 문제는 게임 오브젝트가 여러 콜라이더를 가로질러 움직일 경우 하나 또는 여러 개의 콜라이더가 콜라이더 간의 충돌을 등록할 수 있다는 것입니다. 이것은 콜라이더가 완벽하게 정렬된 경우에도 발생할 수 있습니다. 이 충돌로 인해 콜라이더가 느려지거나 멈출 수 있습니다.
캡슐 콜라이더 2D로 표면을 구성하면 이 문제를 줄이는 데 도움이 될 수 있지만 에지 콜라이더 2D와 같이 하나의 표면에 대해 여러 콜라이더보다 하나의 콜라이더를 사용하는 것이 좋습니다.
CapsuleCollider2D