Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


PhysicsEvents

Various events that can be retrieved during and after the simulation has completed. See PhysicsWorld.Simulate and PhysicsWorld.Simulate.
Read time 3 minutesLast updated 18 days ago

Definition

public readonly struct PhysicsEvents

Static Events

Member

Description

PostSimulateEvent callback for a post-simulate event. This is called after the simulation has finished running and is always called on the main-thread. See PhysicsEvents.PostSimulateEventHandler.
PreSimulateEvent callback for a pre-simulate event. This is called prior to the simulation running and is always called on the main-thread. See PhysicsEvents.PreSimulateEventHandler.

Structs

Struct

Description

PhysicsEvents.BodyUpdateEventAn event produced by a PhysicsBody that indicates the simulation changed the body in one of the following ways:
PhysicsEvents.ContactBeginEventAn event produced by a pair of Shapes, neither of which are a trigger, began touching. The shapes provided may have been destroyed so they should always be validated with PhysicsShape.isValid. See PhysicsWorld.contactBeginEvents.
PhysicsEvents.ContactEndEventAn event produced by a pair of Shapes, neither of which are a trigger, stopped touching. You will get an end event if you do anything that destroys contacts prior to the last world simulation step which include things like setting the body transform, destroying a body etc. The shapes provided may have been destroyed so they should always be validated with PhysicsShape.isValid. See PhysicsWorld.contactEndEvents.
PhysicsEvents.ContactFilterEventAn event produced when a pair of PhysicsShape come into contact. This can be used to decide if a contact between the two shapes should be created or not.
PhysicsEvents.ContactHitEventAn event produced when a pair of PhysicsShape come into contact at relative speed exceeding the PhysicsWorld.contactHitEventThreshold.
PhysicsEvents.JointThresholdEventAn event produced by a Joint which exceeds either its PhysicsJoint.forceThreshold or PhysicsJoint.torqueThreshold.
PhysicsEvents.PreSolveEventAn event produced when a contact between a pair of PhysicsShape is updated, used to provide the ability to decide if the contact should be disabled or not.
PhysicsEvents.TriggerBeginEventAn event produced when a pair of Shapes, one of which was a trigger, began touching. The shapes provided may have been destroyed so they should always be validated with PhysicsShape.isValid. See PhysicsWorld.triggerBeginEvents.
PhysicsEvents.TriggerEndEventAn event produced when a pair of Shapes, one of which was a trigger, stopped touching. An end event will be produced anything that destroys contacts happens, prior to the last world simulation step, which include things like setting the body transform, destroying a body or shape or changing a contact filter etc. The shapes provided may have been destroyed so they should always be validated with PhysicsShape.isValid. See PhysicsWorld.triggerEndEvents.

Delegates

Delegate

Description

PhysicsEvents.PostSimulateEventHandlerEvent handler for a post-simulate event callback. This is called after the simulation has finished running and is always called on the main-thread. See PhysicsWorld and PhysicsEvents.PostSimulate.
PhysicsEvents.PreSimulateEventHandlerEvent handler for a pre-simulate event callback. This is called prior to the simulation running and is always called on the main-thread. See PhysicsWorld and PhysicsEvents.PreSimulate.