Api Sandbox Collider
class

Collider

public abstract class Collider : Component

Properties

Name Type Description
Static Boolean
IsConcave virtual Boolean
IsDynamic Boolean Return true if this collider is using dynamic physics. Returns false if this is a keyframe body, or a static physics body.
Friction Single? Allows overriding the friction for this collider. This value can exceed 1 to to give crazy grippy friction if you want it to, but the normal value is between 0 and 1.
Elasticity Single? Allows overriding the elasticity for this collider. Controls how bouncy this collider is.
RollingResistance Single? Allows overriding the rolling resistance for this collider. Controls how easily rolling shapes (sphere, capsule) roll on surfaces.
Surface Surface
SurfaceVelocity Vector3 Set the local velocity of the surface so things can slide along it, like a conveyor belt
IsTrigger Boolean
LocalBounds virtual BBox Calculated local bounds of all physics shapes in this collider.
OnTriggerEnter Action<Collider> Called when a collider enters this trigger
OnTriggerExit Action<Collider> Called when a collider exits this trigger
OnObjectTriggerEnter Action<GameObject> Called when a gameobject enters this trigger
OnObjectTriggerExit Action<GameObject> Called when a gameobject exits this trigger
Touching IEnumerable<Collider> If we're a trigger, this will list all of the colliders that are touching us. If we're not a trigger, this will list all of the triggers that we are touching.
ColliderFlags ColliderFlags Flags that modify the behavior of this collider
KeyframeBody PhysicsBody
Joints IReadOnlySet<Joint> If we're a keyframe collider, this is the set of joints attached to us. If we're not then this won't ever return anything.
Rigidbody Rigidbody If this collider is part of a Rigidbody then this will return the component that it's attached to. If this is null it's usually a good indication that this collider is either static, world geometry, or a keyframe.

Methods

Void OnPhysicsChanged()
Vector3 GetVelocityAtPoint(Vector3 worldPoint)

Get the velocity of this collider at the specific point in world coordinates.

Vector3 FindClosestPoint(Vector3 worldPoint)

Returns the closest point to the given one between all convex shapes of this body.

BBox GetWorldBounds()

Get the world bounds of this object

Assembly: Sandbox.Engine Namespace: Sandbox Full Name: Sandbox.Collider