Up to date

This page is up to date for Godot 4.2. If you still find outdated information, please open an issue.

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 ( Camera3D camera, InputEvent event, Vector3 position, Vector3 normal, int shape_idx ) virtual

void

_mouse_enter ( ) virtual

void

_mouse_exit ( ) virtual

int

create_shape_owner ( Object owner )

bool

get_collision_layer_value ( int layer_number ) const

bool

get_collision_mask_value ( int layer_number ) const

RID

get_rid ( ) const

PackedInt32Array

get_shape_owners ( )

bool

is_shape_owner_disabled ( int owner_id ) const

void

remove_shape_owner ( int owner_id )

void

set_collision_layer_value ( int layer_number, bool value )

void

set_collision_mask_value ( int layer_number, bool value )

int

shape_find_owner ( int shape_index ) const

void

shape_owner_add_shape ( int owner_id, Shape3D shape )

void

shape_owner_clear_shapes ( int owner_id )

Object

shape_owner_get_owner ( int owner_id ) const

Shape3D

shape_owner_get_shape ( int owner_id, int shape_id ) const

int

shape_owner_get_shape_count ( int owner_id ) const

int

shape_owner_get_shape_index ( int owner_id, int shape_id )