# 3D Physics Playground falling bodies and a walking character. ```{raw} html ▶ Run in browser ``` **Tags:** `physics` `3d` `character` Drop a batch of spheres and boxes onto a static slab, then walk a glowing character through the pile. The character is an ordinary kinematic body, so the falling bodies collide with it and can come to rest on its head; walk out from under a resting box and it is left behind to fall, because a character carries no riders. Shows: - PhysicsBody3D (mode=DYNAMIC) spheres and boxes falling under gravity and resting or stacking on a PhysicsBody3D (mode=STATIC) slab; the world steps them and writes their poses back to the nodes each fixed step. - CharacterBody3D moved with move_and_slide() and is_on_floor(), with gravity read from the world it lives in and integrated by game code each fixed step. move_and_slide writes the deflected velocity back, so the next step reads its vertical speed straight off the character. - The standard body recipe: a CollisionShape3D child for the physics plus a MeshInstance3D child for the visual, which inherits the body's transform. - A VirtualJoystick and VirtualButtons that inject the same keys the keyboard uses, so the demo plays with a mouse or a finger as well. The world is Y-up, so gravity (-Y) and the visuals agree. Movement is camera-relative: pushing the stick (or W) away from you walks the character away from the camera, whichever way it is orbited. Controls: WASD - move the character (camera-relative) Arrows - orbit the camera R - drop a fresh batch of bodies Escape - quit On-screen stick and buttons - move, orbit, drop (mouse or touch) Run: uv run python examples/features/physics/playground3d.py Headless self-check: uv run python examples/features/physics/playground3d.py --test ## Source ```{literalinclude} ../../examples/features/physics/playground3d.py :language: python :linenos: ```