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.

CollisionObject2D

Inherits: Node2D < CanvasItem < Node < Object

Inherited By: Area2D, PhysicsBody2D

Abstract base class for 2D physics objects.

Description

Abstract base class for 2D physics objects. CollisionObject2D can hold any number of Shape2Ds 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.

Note: Only collisions between objects within the same canvas (Viewport canvas or CanvasLayer) are supported. The behavior of collisions between objects in different canvases is undefined.

Properties

int

collision_layer

1

int

collision_mask

1

float

collision_priority

1.0

DisableMode

disable_mode

0

bool

input_pickable

true

Methods

void

_input_event ( Viewport viewport, InputEvent event, int shape_idx ) virtual

void

_mouse_enter ( ) virtual

void

_mouse_exit ( ) virtual