Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


preContactCallbacks

Controls if pre-contact and pre-continuous callbacks will be called. 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 14 days ago

Definition

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

Remarks

A shape only produces these callbacks if its own _preContactCallbacks is also set. The deprecated IPreSolveCallback is also driven by this switch, for targets that only implement it.