Protected
constructorDamping applied to angular velocity, in the range 0.0 (no damping) to 1.0 (maximum damping).
Angular velocity, expressed as an axis of rotation scaled by angular speed (radians/s).
Damping applied to linear velocity, in the range 0.0 (no damping) to 1.0 (maximum damping). This produces an effect similar to drag in that it causes the object to slow down over time. It is not however physically accurate, and it doesn't take into account surface area or mass.
Toggle collider wire rendering for visualizing collider geometry shape and where it is placed.
Density (kg/L) of the object, used to derive mass from volume. If modified, mass changes according to shape and scale.
If enabled, the body is dynamically simulated, such that it responds to forces and collisions. Otherwise, it acts as a static collider, functionally equivalent to Physics.ColliderComponent.
If disabled, the Component will stop enacting its behavior.
Collision filter to use for this collider.
If enabled, the collider shape extends to fit the visual mesh, if any. Only applicable for Box and Sphere shapes.
Nested collider/body components may be merged into compound shapes. By default, this occurs only for dynamic bodies and not for static colliders. If forceCompound
is set, this occurs for static colliders as well.
If enabled, the collider doesn't interact with the world but may still be detected with ray casts and intersection events.
Mass (kg) of the object. If modified from this field, mass is constant irrespective of shape and scale.
The matter used by the collider to define its physical substance, such as friction and bounciness.
Readonly
onSignals when objects initially collide.
Readonly
onSignals when objects stop colliding.
Readonly
onSignals every frame while objects continue to collide.
Readonly
onSignals when colliders first overlap.
Readonly
onSignals when colliders stop overlapping.
Readonly
onSignals every frame while colliders continue to overlap.
Collision filter used for overlap events.
Smoothing spring factor, for rotation.
Readonly
sceneThe scene object this component is on.
The Shape object used for collision.
Smooth transform changes using a dampened spring. Useful to reduce motion noise. This only applies to the simulation and changes from outside the simulation. The scene object's transform is not affected. It has no effect for dynamic bodies.
Smoothing spring factor, for translation. This controls the restitution strength of the spring, so low values are smoother but lag more.
Readonly
uniqueLinear velocity (cm/s).
The WorldSettingsAsset used by the collider to define the physics simulation settings.
Add a point constraint between this body and the given collider, at the given position. target
is optional. If null, it is statically constrained to the world. This is a convenience function that creates a child SceneObject with a ConstraintComponent, and sets its type, target, and constraint parameters. To fully remove the constraint, its SceneObject must be removed - not the component. Call removeConstraint()
to do this.
Clears all velocities and forces on a collider.
Destroys the component.
Returns the SceneObject the component is attached to.
Returns the Transform this component is attached to.
Returns the name of this object's type.
Returns true if the object matches or derives from the passed in type.
Returns true if this object is the same as other
. Useful for checking if two references point to the same thing.
Removes a constraint that was added with one of the add*Constraint()
functions.
Allows Physics simulation to control SceneObject.
Remarks
Derived from ColliderComponent, attaching this to a SceneObject turns it into a dynamic rigid-body that is automatically moved by the physics simulation in response to gravity, collisions, and other forces.
See
Example