Version: Unity 6.7 Beta (6000.7)
LanguageEnglish
  • C#

PreContactEvent

struct in Unity.U2D.Physics

Suggest a change

Success!

Thank you for helping us improve the quality of Unity Documentation. Although we cannot accept all submissions, we do read each suggested change from our users and will make updates where applicable.

Close

Submission failed

For some reason your suggested change could not be submitted. Please <a>try again</a> in a few minutes. And thank you for taking the time to help us improve the quality of Unity Documentation.

Close

Cancel

Description

An event produced when a contact between a pair of shapes is updated, giving the opportunity to modify the contact manifold before it is solved. The event is passed to the callback by reference so the manifold can be changed, and calling Cancel cancels the contact.

Properties

Property Description
manifold The contact manifold that is about to be solved. This can be modified in place, and because the event itself is passed to the callback by reference, the solver uses whatever it is left as this step.
physicsWorld The physics world both shapes are within.
shapeA One of the shapes involved in the event.
shapeB The other shape involved in the event.

Public Methods

Method Description
Cancel Cancels the contact so it is not solved this step. The manifold is left with no points.