Version: 2021.3
언어: 한국어

Physics.ContactModifyEvent

매뉴얼로 전환

파라미터

value A delegate to call.

설명

Subscribe to this event to be able to customize the collision response for contact pairs.

Each subscriber to this event gets invoked with a physics scene and a native array of contact pairs to process. Each contact pair has modifiable data, like impulses and contact normals that can be changed in order to customize the bounce behavior.

Only pairs containing Colliders that had Collider.hasModifiableContacts enabled will be passed in the buffer.

Note that this event is called from any thread, so it's advisable to keep copies of all necessary for handling data because only a portion of Unity API is available off the main thread.

Additionally, an event handler can be invoked multiple times per frame, because the physics system distributes all contacts among threads, and only sends a particular amount of contacts per call.

Note: to get contact pairs that have been generated by the CCD solver, subscribe to the Physics.ContactModifyEventCCD event. They are not included in this event.