CollisionShape3D
Attaches a shape resource to a 3D body or area.
CollisionShape3D must be a direct child of a suitable CollisionObject. Shape is shared: resizing a common resource affects every instance using it. Assign a Duplicate before editing independent geometry.
Change resource dimensions with unit scale in the physics branch, including inherited scale checks. Disabled removes the shape from physics participation after application. Use SetDeferred inside a physics signal rather than immediate restructuring. Hiding the visible model does not disable collision.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
CollisionShape3DConstructor
public CollisionShape3D();Properties4
DebugColorProperty
public Color DebugColor { get; set; }The collision shape color that is displayed in the editor, or in the running project if Debug > Visible Collision Shapes is checked at the top of the editor.
Note: The default value is ProjectSettings.debug/shapes/collision/shape_color. The Color(0, 0, 0, 0) value documented here is a placeholder, and not the actual default debug color.
DebugFillProperty
public bool DebugFill { get; set; }If true, when the shape is displayed, it will show a solid fill color in addition to its wireframe.
DisabledProperty
public bool Disabled { get; set; }Excludes the shape from physics participation after application. Use SetDeferred from a physics callback; hiding artwork does not substitute for this flag.
ShapeProperty
public Shape3D Shape { get; set; }A geometry resource that can be shared across instances. Resizing affects all users; assign a Duplicate first for an independent collider.
Methods10
GetDebugColorColor
public Color GetDebugColor();ColorGetEnableDebugFillbool
public bool GetEnableDebugFill();boolGetShapeShape3D
public Shape3D GetShape();Shape3DIsDisabledbool
public bool IsDisabled();boolMakeConvexFromSiblingsvoid
public void MakeConvexFromSiblings();Sets the collision shape's shape to the addition of all its convexed MeshInstance3D siblings geometry.
ResourceChangedvoid · Deprecated
public void ResourceChanged(Resource resource);This method does nothing.
| Name | Type | Default |
|---|---|---|
resource | Resource | — |
SetDebugColorvoid
public void SetDebugColor(Color color);| Name | Type | Default |
|---|---|---|
color | Color | — |
SetDisabledvoid
public void SetDisabled(bool enable);| Name | Type | Default |
|---|---|---|
enable | bool | — |
SetEnableDebugFillvoid
public void SetEnableDebugFill(bool enable);| Name | Type | Default |
|---|---|---|
enable | bool | — |
SetShapevoid
public void SetShape(Shape3D shape);| Name | Type | Default |
|---|---|---|
shape | Shape3D | — |