Next: , Previous: , Up: Motion   [Contents][Index]


12.15 Physics Toggle

Component: PhysicsToggle

This component allows the physics simulation of a given object to be toggled based on messages. ’EnablePhysics’ and ’DisablePhysics’ take no parameters. ’SwapPhysics’ takes no parameter and will reverse the physics state of the object. It also optionally changes the ’convex’ state of a collider based on physics state (recommended for advanced users only)

To use, add to a physics object and when appropriate, send messages to this component using any message sender (such as ActiveCollider).

Field of PhysicsToggle: float delay

Is there a delay when toggling?

Default value: 0.0f

Field of PhysicsToggle: bool nullifyMotion

Should we force any movement to stop?

Default value: false

Field of PhysicsToggle: bool controlColliderState

Should this object control the ’Convex’ state of the collider also? This will force non-convex colliders to become convex if they need to move. But be careful, this can cause physics glitches in some circumstances!

Default value: false

Available Messages

Message on PhysicsToggle: DisablePhysics ()

Disables physics calculations on this object (it will still collide with objects if it has a collider)

Message on PhysicsToggle: EnablePhysics ()

Disables physics calculations on this object

Message on PhysicsToggle: SwapPhysics ()

Toggles the physics state of this object.

Field of PhysicsToggle: float delay

Is there a delay when toggling?

Default value: 0.0f

Field of PhysicsToggle: bool nullifyMotion

Should we force any movement to stop?

Default value: false

Field of PhysicsToggle: bool controlColliderState

Should this object control the ’Convex’ state of the collider also? This will force non-convex colliders to become convex if they need to move. But be careful, this can cause physics glitches in some circumstances!

Default value: false

Available Messages

Message on PhysicsToggle: DisablePhysics ()

Disables physics calculations on this object (it will still collide with objects if it has a collider)

Message on PhysicsToggle: EnablePhysics ()

Disables physics calculations on this object

Message on PhysicsToggle: SwapPhysics ()

Toggles the physics state of this object.


Next: , Previous: , Up: Motion   [Contents][Index]