Skip to content

Physics 2D actions

19 actions in the Physics 2D category. Each block mirrors how the action appears in the editor's sidebar.

Accelerate

Physics
Accelerate Physics 2D
Node not set | Direction (0.0, 0.0) | Amount 30.0

Pushes the body a little further in a direction every frame, adding to the speed it already carries instead of replacing it. With Amount = 30 toward a grapple point, the body builds up a swing and keeps it after the pull stops.

Input Type Default Description
Node Node - The body to push. Leave it empty to push this node.
Direction Vector2 (0.0, 0.0) Which way to push. Only the direction is used, the length is ignored.
Amount float 30.0 How much speed to add per second.

Phases Every FramePhysics Works on CharacterBody2D

Apply Force

Physics
Apply Force Physics 2D
Node not set | Force (0.0, 0.0) | Offset (0.0, 0.0)

Pushes a physics body continuously every physics frame while the state runs, such as thrust or wind. For a one-shot push use Apply Impulse.

Input Type Default Description
Node Node - The body to push. Leave it empty to push this node.
Force Vector2 (0.0, 0.0) The push to apply each frame, in pixels times mass per second squared.
Offset Vector2 (0.0, 0.0) Where the push is applied, relative to the center. Zero pushes through the center.

Phases Every FramePhysics Works on RigidBody2D

Apply Gravity

Physics
Apply Gravity Physics 2D
Node not set | Gravity 980.0

Pulls the body downward by adding gravity to its velocity every physics frame, so it falls faster the longer it drops.

Input Type Default Description
Node Node - The body to pull down. Leave it empty to pull this node.
Gravity float 980.0 How strong the downward pull is, in pixels per second squared.

Phases Every FramePhysics Works on CharacterBody2D

Apply Impulse

Start
Apply Impulse Physics 2D
Node not set | Impulse (0.0, 0.0) | Offset (0.0, 0.0)

Gives a physics body a one-shot push, such as a jump or a boost. Best placed on enter so it fires once instead of every frame.

Input Type Default Description
Node Node - The body to kick. Leave it empty to kick this node.
Impulse Vector2 (0.0, 0.0) The push to apply, in pixels times mass per second.
Offset Vector2 (0.0, 0.0) Where the push is applied, relative to the center. Zero pushes through the center.

Phases StartEvery FramePhysics Works on RigidBody2D

Apply Torque Impulse

Start
Apply Torque Impulse Physics 2D
Node not set | Torque 0.0

Gives a physics body a one-shot spin, such as a flip. Best placed on enter so it fires once instead of every frame.

Input Type Default Description
Node Node - The body to spin. Leave it empty to spin this node.
Torque float 0.0 The spin to apply. Positive turns one way, negative the other.

Phases StartEvery FramePhysics Works on RigidBody2D

Cast Ray

Physics
Cast Ray Physics 2D
Node not set | From (0.0, 0.0) | To (0.0, 0.0) | Ignore Self true | → Hit | → Miss

Shoots an invisible line between two points and branches on whether it touched anything. On a hit it reports the node that was touched, the contact point and the surface normal.

Input Type Default Description
Node Node - The node the ray starts from. Leave it empty to start from this node.
From Vector2 (0.0, 0.0) The global point the line starts at, usually the position of this node.
To Vector2 (0.0, 0.0) The global point the line ends at.
Ignore Self bool true True to skip the body of this node, so a line starting inside it does not hit it.
Output Type Description
Collider Object The node the line touched.
Point Vector2 The global position where the line touched it.
Normal Vector2 The direction the touched surface faces.
Branch Goes to
Hit Where to go when the line touches something.
Miss Where to go when the line touches nothing.

Phases StartEvery FramePhysics Works on Node2D

Freeze Body

Start
Freeze Body Physics 2D
not set

Brings a physics body fully to rest by zeroing its linear and angular velocity at once. This is what a reset or respawn needs so the body neither drifts nor spins.

Input Type Default Description
Node Node - The body to stop. Leave it empty to stop this node.

Phases StartEvery FramePhysicsEnd Works on RigidBody2D

Get Velocity

Physics
Get Velocity Physics 2D
not set

Reads the current body velocity and stores it, in pixels per second. Useful to react to how fast the body is moving.

Input Type Default Description
Node Node - The body to read. Leave it empty to read this node.
Output Type Description
Velocity Vector2 Where to store the current velocity, in pixels per second.

Phases StartEvery FramePhysics Works on CharacterBody2D

Is On Ceiling

Physics
Is On Ceiling Physics 2D
not set | → True | → False

Answers whether the body hit a ceiling, from the contact of the last Move And Slide. It can branch on the answer or hand it to a field that takes a yes or no.

Input Type Default Description
Node Node - The body to check. Leave it empty to check this node.
Output Type Description
Yes bool Where to store whether the body hit a ceiling.
Branch Goes to
True Where to go when the body touches a ceiling.
False Where to go when the body touches no ceiling.

Phases StartEvery FramePhysics Works on CharacterBody2D

Is On Floor

Physics
Is On Floor Physics 2D
not set | → True | → False

Answers whether the body is standing on the floor, from the contact of the last Move And Slide. It can branch on the answer or hand it to a field that takes a yes or no.

Input Type Default Description
Node Node - The body to check. Leave it empty to check this node.
Output Type Description
Yes bool Where to store whether the body is on the floor.
Branch Goes to
True Where to go when the body is on the floor.
False Where to go when the body is in the air.

Phases StartEvery FramePhysics Works on CharacterBody2D

Is On Wall

Physics
Is On Wall Physics 2D
not set | → True | → False

Answers whether the body is pressed against a wall, from the contact of the last Move And Slide. It can branch on the answer or hand it to a field that takes a yes or no.

Input Type Default Description
Node Node - The body to check. Leave it empty to check this node.
Output Type Description
Yes bool Where to store whether the body is against a wall.
Branch Goes to
True Where to go when the body touches a wall.
False Where to go when the body touches no wall.

Phases StartEvery FramePhysics Works on CharacterBody2D

Jump

Start
Jump Physics 2D
Node not set | Force 400.0

Pushes the body upward, but only when it is standing on the floor. Sets the upward velocity to the given force.

Input Type Default Description
Node Node - The body to jump. Leave it empty to jump this node.
Force float 400.0 How hard the jump is, in pixels per second.

Phases StartEvery FramePhysics Works on CharacterBody2D

Move And Collide

Physics
Move And Collide Physics 2D
Node not set | Motion (0.0, 0.0) | → Hit | → Miss

Moves the body by an amount and stops at the first obstacle, then branches on whether it hit. On a hit it reports the collider, the contact point and the surface normal.

Input Type Default Description
Node Node - The body to move. Leave it empty to move this node.
Motion Vector2 (0.0, 0.0) How far to move this step, in pixels.
Output Type Description
Collider Object The node the body hit.
Point Vector2 The position where the contact happened.
Normal Vector2 The direction the hit surface faces.
Branch Goes to
Hit Where to go when the move hits something.
Miss Where to go when the move hits nothing.

Phases Every FramePhysics Works on CharacterBody2D

Move And Slide

Physics
Move And Slide Physics 2D
not set | → Hit Something | → Clear

Moves the body with its current velocity, resolving collisions. Place it after the actions that set the velocity.

Input Type Default Description
Node Node - The body to move. Leave it empty to move this node.
Branch Goes to
Hit Something Where to go when the move ran into a wall, a floor or another body.
Clear Where to go when the move touched nothing.

Phases StartEvery FramePhysicsEnd Works on CharacterBody2D

Move Forward

Physics
Move Forward Physics 2D
Node not set | Speed 200.0

Sets the body velocity to move along the direction it is facing. A negative speed moves it backward, and it only moves once Move And Slide runs.

Input Type Default Description
Node Node - The body to move. Leave it empty to move this node.
Speed float 200.0 How fast to move along the facing, in pixels per second.

Phases StartEvery FramePhysicsEnd Works on CharacterBody2D

Push

Physics
Push Physics 2D
Node not set | Direction (0.0, 0.0) | Amount 12.0

Shoves the body once, adding the whole Amount to its speed in one shot, while Accelerate adds Amount per second for as long as it runs. With Amount = 12 pointing away from an attacker it reads as knockback, and the same shove drives a jump pad or an explosion.

Input Type Default Description
Node Node - The body to push. Leave it empty to push this node.
Direction Vector2 (0.0, 0.0) Which way to shove. Only the direction is used, the length is ignored.
Amount float 12.0 How much speed the shove adds, all at once.

Phases StartEvery FramePhysics Works on CharacterBody2D

Set Angular Velocity

Physics
Set Angular Velocity Physics 2D
Node not set | Speed 0.0

Sets the angular velocity (spin) of a physics body directly, in degrees per second. Zero stops the spin.

Input Type Default Description
Node Node - The body to spin. Leave it empty to spin this node.
Speed float 0.0 The spin to set, in degrees per second. Zero stops the spin.

Phases StartEvery FramePhysicsEnd Works on RigidBody2D

Set Linear Velocity

Physics
Set Linear Velocity Physics 2D
Node not set | Velocity (0.0, 0.0)

Sets the linear velocity of a physics body directly, in pixels per second. Setting it to zero stops the body, which is how a reset brings it to rest.

Input Type Default Description
Node Node - The body to change. Leave it empty to change this node.
Velocity Vector2 (0.0, 0.0) The velocity to set, in pixels per second. Zero stops the body.

Phases StartEvery FramePhysicsEnd Works on RigidBody2D

Set Velocity

Physics
Set Velocity Physics 2D
Node not set | Velocity (0.0, 0.0)

Sets the body velocity directly, in pixels per second. It only moves the body once Move And Slide runs.

Input Type Default Description
Node Node - The body to change. Leave it empty to change this node.
Velocity Vector2 (0.0, 0.0) The velocity to apply, in pixels per second.

Phases StartEvery FramePhysicsEnd Works on CharacterBody2D