RigidBody Character 3D Demo's icon

RigidBody Character 3D Demo 4.2-31d1c0c Demos 4.2 Featured

Submitted by user Godot Engine; MIT; 2024-03-28

RigidBody character demo for 3D using a capsule for the character. Cubes as RigidBodies spawn in the map from above to show interaction with the player (jump on them, gently push them), which would be impossible with a KinematicBody.

How it works:

This demo uses a RigidBody3D node for the player, and StaticBody3D node for the level. Each has colliders, the player moves itself via `apply_central_impulse()` in `_physics_process()`, and collides with the level.

The ShapeCast3D node is used to detect whether the player is able to jump (i.e. touching the floor). Compared to a RayCast3D node which is infinitely thin, this allows for more reliable checking if the player is standing over an edge or
corner.

Language: GDScript

Renderer: Forward+


View files Download Submit an issue Recent Edits