Hugo Locurcio 2a962929f3 Update demo files for Godot 4.2.1 (#1013) | há 9 meses atrás | |
---|---|---|
.. | ||
models | há 9 meses atrás | |
player | há 1 ano atrás | |
screenshots | há 1 ano atrás | |
README.md | há 1 ano atrás | |
cube_rigidbody.tscn | há 1 ano atrás | |
cubelib.tres | há 1 ano atrás | |
default_env.tres | há 1 ano atrás | |
icon.webp | há 1 ano atrás | |
icon.webp.import | há 1 ano atrás | |
level.gd | há 2 anos atrás | |
level.tscn | há 1 ano atrás | |
project.godot | há 9 meses atrás |
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
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.