Hugo Locurcio 2a962929f3 Update demo files for Godot 4.2.1 (#1013) 9 luni în urmă
..
models 2a962929f3 Update demo files for Godot 4.2.1 (#1013) 9 luni în urmă
player 1d5184e235 Update most demos for Godot 4.0.beta10 (#782) 1 an în urmă
screenshots 1d5184e235 Update most demos for Godot 4.0.beta10 (#782) 1 an în urmă
README.md 1d5184e235 Update most demos for Godot 4.0.beta10 (#782) 1 an în urmă
cube_rigidbody.tscn 1d5184e235 Update most demos for Godot 4.0.beta10 (#782) 1 an în urmă
cubelib.tres b47178faac Use a different color for moving platforms in platformer demos (#907) 1 an în urmă
default_env.tres 1d5184e235 Update most demos for Godot 4.0.beta10 (#782) 1 an în urmă
icon.webp 63d1cd9a60 Use 128×128 WebP icons for all demos (#885) 1 an în urmă
icon.webp.import 63d1cd9a60 Use 128×128 WebP icons for all demos (#885) 1 an în urmă
level.gd bbe50fc9da Convert demos to Godot 4 using regular expressions in a script 2 ani în urmă
level.tscn b47178faac Use a different color for moving platforms in platformer demos (#907) 1 an în urmă
project.godot 2a962929f3 Update demo files for Godot 4.2.1 (#1013) 9 luni în urmă

README.md

RigidBody Character 3D

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.

Language: GDScript

Renderer: GLES 3

Check out this demo on the asset library: https://godotengine.org/asset-library/asset/1291

How does it work?

This demo uses a RigidBody for the player, and StaticBody 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 which is infinitely thin, this allows for more reliable checking if the player is standing over an edge or corner.

Screenshots

Screenshot