PhysicsBody2D

Inherits: CollisionObject2D < Node2D < CanvasItem < Node < Object

Inherited By: KinematicBody2D, RigidBody2D, StaticBody2D

Base class for all objects affected by physics in 2D space.

Description

PhysicsBody2D is an abstract base class for implementing a physics body. All *Body2D types inherit from it.

Tutorials

Properties

bool

input_pickable

false (overrides CollisionObject2D)

int

layers

Methods

void

add_collision_exception_with ( Node body )

Array

get_collision_exceptions ( )

void

remove_collision_exception_with ( Node body )


Property Descriptions

int layers

Both collision_layer and collision_mask. Returns collision_layer when accessed. Updates collision_layer and collision_mask when modified.


Method Descriptions

void add_collision_exception_with ( Node body )

Adds a body to the list of bodies that this body can't collide with.


Array get_collision_exceptions ( )

Returns an array of nodes that were added as collision exceptions for this body.


void remove_collision_exception_with ( Node body )

Removes a body from the list of bodies that this body can't collide with.