Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


preContactCallbacks

Controls whether this shape produces pre-contact and pre-continuous callbacks. This only applies to Dynamic bodies and is ignored for triggers. These are relatively expensive so disabling them can provide a significant performance benefit.
Read time 1 minuteLast updated 12 days ago

Definition

  • Type: Property
  • Namespace: Unity.U2D.Physics
  • Assembly: UnityEngine.PhysicsCore2DModule
public bool preContactCallbacks { readonly get; set; }

Remarks

A pre-contact callback calls the _callbackTarget if it implements PhysicsCallbacks.IPreContactCallback, and a pre-continuous callback if it implements PhysicsCallbacks.IPreContinuousCallback. The deprecated IPreSolveCallback is also driven by this switch, for targets that only implement it.