Hugo Locurcio a531235db3 Use Jolt Physics in all 3D demos that use physics, improve physics tests demos (#1195) 3 місяців тому
..
models 4d49bbd1b8 Update demos for Godot 4.4 4 місяців тому
player 819d201cc4 Enable physics interpolation in all 3D demos (#1074) 3 місяців тому
screenshots 1d5184e235 Update most demos for Godot 4.0.beta10 (#782) 2 роки тому
README.md 16d8ba09fb Replace instances of KinematicBody with CharacteBody in READMEs 1 рік тому
cube_rigidbody.tscn 1d5184e235 Update most demos for Godot 4.0.beta10 (#782) 2 роки тому
cubelib.tres 90617ba1e8 Fix camera colliding with the player in 3D platformer demo (#1187) 3 місяців тому
icon.webp 63d1cd9a60 Use 128×128 WebP icons for all demos (#885) 2 роки тому
icon.webp.import 63d1cd9a60 Use 128×128 WebP icons for all demos (#885) 2 роки тому
level.gd bac1e69164 Use static typing in all demos (#1063) 1 рік тому
level.gd.uid 4d49bbd1b8 Update demos for Godot 4.4 4 місяців тому
level.tscn 90617ba1e8 Fix camera colliding with the player in 3D platformer demo (#1187) 3 місяців тому
project.godot a531235db3 Use Jolt Physics in all 3D demos that use physics, improve physics tests demos (#1195) 3 місяців тому

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 CharacterBody.

Language: GDScript

Renderer: Forward+

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

How does it work?

This demo uses a RigidBody3D for the player, and StaticBody3D 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