Version: 2023.2
LanguageEnglish
  • C#

Physics2D.callbacksOnDisable

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

public static bool callbacksOnDisable;

Description

Use this to control whether or not the appropriate OnCollisionExit2D or OnTriggerExit2D callbacks should be called when a Collider2D is disabled.

If the Collider2D being disabled has at least a single contact with another Collider2D then with this property set to true, a callback would be produced. With the property set to false, no callback would be produced.

Only "OnCollisionExit2D" or "OnTriggerExit2D" will be called by disabling a Collider2D.