Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

CollisionObject3D

Inherits: Node3D < Node < Object

Inherited By: Area3D, PhysicsBody3D

Abstract base class for 3D physics objects.

Description

Abstract base class for 3D physics objects. CollisionObject3D can hold any number of Shape3Ds for collision. Each shape must be assigned to a shape owner. Shape owners are not nodes and do not appear in the editor, but are accessible through code using the shape_owner_* methods.

Warning: With a non-uniform scale, this node will likely not behave as expected. It is advised to keep its scale the same on all axes and adjust its collision shape(s) instead.

Properties

int

collision_layer

1

int

collision_mask

1

float

collision_priority

1.0

DisableMode

disable_mode

0

bool

input_capture_on_drag

false

bool

input_ray_pickable

true

Methods

void

_input_event(camera: Camera3D, event: InputEvent, position: Vector3, normal: Vector3, shape_idx: int) virtual

void

_mouse_enter() virtual

void

_mouse_exit() virtual

int

create_shape_owner(owner: Object)

bool

get_collision_layer_value(layer_number: int) const

bool

get_collision_mask_value(layer_number: int) const

RID

get_rid() const

PackedInt32Array

get_shape_owners()

bool

is_shape_owner_disabled(owner_id: int) const

void

remove_shape_owner(owner_id: int)

void

set_collision_layer_value(layer_number: int, value: bool)

void

set_collision_mask_value(layer_number: int, value: bool)

int

shape_find_owner(shape_index: int) const

void

shape_owner_add_shape(owner_id: int, shape: Shape3D)

void

shape_owner_clear_shapes(owner_id: int)

Object

shape_owner_get_owner(owner_id: int) const

Shape3D

shape_owner_get_shape(owner_id: int, shape_id: int) const

int

shape_owner_get_shape_count(owner_id: int) const

int

shape_owner_get_shape_index(owner_id: int, shape_id: int) const

Transform3D

shape_owner_get_transform(owner_id: int) const

void

shape_owner_remove_shape(owner_id: int, shape_id: int)