19 actions in the Physics 2D category.
Each block mirrors how the action appears in the editor's sidebar.
Accelerate
Physics
AcceleratePhysics 2D
Nodenot set|Direction(0.0, 0.0)|Amount30.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.
PhasesEvery FramePhysicsWorks onCharacterBody2D
Apply Force
Physics
Apply ForcePhysics 2D
Nodenot 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.
PhasesEvery FramePhysicsWorks onRigidBody2D
Apply Gravity
Physics
Apply GravityPhysics 2D
Nodenot set|Gravity980.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.
PhasesEvery FramePhysicsWorks onCharacterBody2D
Apply Impulse
Start
Apply ImpulsePhysics 2D
Nodenot 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.
PhasesStartEvery FramePhysicsWorks onRigidBody2D
Apply Torque Impulse
Start
Apply Torque ImpulsePhysics 2D
Nodenot set|Torque0.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.
PhasesStartEvery FramePhysicsWorks onRigidBody2D
Cast Ray
Physics
Cast RayPhysics 2D
Nodenot set|From(0.0, 0.0)|To(0.0, 0.0)|Ignore Selftrue|→ 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.
PhasesStartEvery FramePhysicsWorks onNode2D
Freeze Body
Start
Freeze BodyPhysics 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.
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.
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.
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.
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.
PhasesEvery FramePhysicsWorks onCharacterBody2D
Move And Slide
Physics
Move And SlidePhysics 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.
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.