Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


PhysicsEvents.PreContactEvent

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.
Read time 1 minuteLast updated 17 days ago

Definition

  • Type: Struct
  • Namespace: Unity.U2D.Physics
  • Assembly: UnityEngine.PhysicsCore2DModule
public struct PhysicsEvents.PreContactEvent

Fields

Value

Description

manifoldThe 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.

Properties

Property

Description

physicsWorldThe physics world both shapes are within.
shapeAOne of the shapes involved in the event.
shapeBThe other shape involved in the event.

Methods

Method

Description

CancelCancels the contact so it is not solved this step. The manifold is left with no points.