Godot Area2D vs StaticBody2D vs RigidBody2D vs KinematicBody2D

Mar 5, 2021

Area2D

  • Area2D nodes provide detection and influence.
  • They can detect when objects overlap and can emit signals when bodies enter or exit.
  • To override physics properties, such as gravity or damping, in a defined area.

Usages

  • Overriding physics parameters (such as gravity) in a given region.
  • Detect collision (if another body enter or exit)

Example

  • Coin (detect collision if player collect it, but doesn't block player entering the coin, and no physic collision response required)
  • Fire/Spike Pit which incur damage to player
  • Sticky Floor area which slow movement

StaticBody2D

  • A static object which doesn't response to collision.

Example

  • Platform, Conveyor belts
  • Wall, Floor
  • Obstacle

RigidBody2D

  • For object which response to collision/force, but you don't control the object directly (you apply force to it).

Example

  • Falling blocks (Angry Birds)
  • Kick a ball.

KinematicBody2D

  • A object where movement can be controlled directly, but collision response is implement manually by code.

Example

  • Player, Moving Enemy

References:

❤️ Is this article helpful?

Buy me a coffee ☕ or support my work via PayPal to keep this space 🖖 and ad-free.

Do send some 💖 to @d_luaz or share this article.

✨ By Desmond Lua

A dream boy who enjoys making apps, travelling and making youtube videos. Follow me on @d_luaz

👶 Apps I built

Travelopy - discover travel places in Malaysia, Singapore, Taiwan, Japan.