Documentation

Unity Engine

Download Unity

Unity Engine

Destroy(bool, int)

Destroy the shape, destroying all PhysicsShape.Contact the shape is involved in. If the object is owned with PhysicsShape.SetOwner then you must provide the owner key it returned. Failing to do so will return a warning and the shape will not be destroyed. The lifetime of the specified owner object
Read time 1 minuteLast updated 9 hours ago

Definition

public bool Destroy(bool updateBodyMass = true, int ownerKey = 0)

Parameters

updateBodyMass

Optional flag indicating if the body mass configuration should be updated. Not doing so is faster, especially when destroying multiple shapes.

ownerKey

Optional owner key returned when using PhysicsShape.SetOwner.

Returns

Type

Description

boolIf the shape was destroyed or not.