Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


PhysicsCallbacks.IPreSolveCallback

An interface that when implemented by a Object, can be called as a target when a PhysicsShape has _preSolveCallbacks set to true. The PhysicsWorld the PhysicsShape is in also has to have its _preSolveCallbacks set to true.
Read time 1 minuteLast updated 10 days ago

Definition

  • Type: Interface
  • Namespace: Unity.U2D.Physics
  • Assembly: UnityEngine.PhysicsCore2DModule
public interface PhysicsCallbacks.IPreSolveCallback

Methods

Method

Description

OnPreSolve2DCalled when a contact between a pair of shapes is updated. This allows a contact to be disabled before it goes to the solver. A typical use-case would be to implement a one-way behaviour based upon the provided contact. This is only called if the PhysicsWorld has _preSolveCallbacks set to true. An event is only produced if one of the PhysicsShape have _preSolveCallbacks set to true. This is only called for Awake Dynamic bodies. This is not called for triggers.