1.1 KiB
1.1 KiB
Section 05 - Lesson 04 | Physics Nodes Review
Notes
Physics2D Nodes
- StaticBody2D
- useful for floor and walls
- CharacterBody2D
-
characters
- set velocity
- physics collisions
- scripting
- AnimatableBody2D
- moving platforms and doors
- RigidBody2D
-
objects that have gravity and can be pushed by other objects
- set force or impulse to it
- e.g. thrust for rocket, tennis ball hit by racket
how it works
- we do not control position, the engine does
- we supply velocity or force
- engine calucates where we go and speed / position
Area2D vs Physics2D
similarities
- has one or more CollisionShape2D
- Sprite2D
differences
- much easier on calculations
- checks if one shape overlapping another
- Area2D is much more inaccurate in collisions