bool IsDynamic { get; set; }

book_4_sparkGenerated
code_blocksInput

Description

The IsDynamic property of the Collider class indicates whether the collider is using dynamic physics. If the collider is dynamic, it will return true. If the collider is a keyframe body or a static physics body, it will return false.

Usage

Use the IsDynamic property to determine the physics behavior of a collider. This can be useful for deciding how to handle collisions or interactions with other objects in the scene.

Example

// Example of checking if a collider is dynamic
Collider myCollider = new Collider();

if (myCollider.IsDynamic)
{
    // Handle dynamic physics behavior
    // For example, apply forces or respond to collisions
}
else
{
    // Handle static or keyframe behavior
    // For example, ignore certain interactions
}