Aaron Franke 5646c6a7a8 Open and save 3D demos in Godot 4.3 stable (#1109) | il y a 4 mois | |
---|---|---|
.. | ||
models | il y a 4 mois | |
player | il y a 7 mois | |
screenshots | il y a 2 ans | |
README.md | il y a 5 mois | |
cube_rigidbody.tscn | il y a 2 ans | |
cubelib.tres | il y a 4 mois | |
icon.webp | il y a 1 an | |
icon.webp.import | il y a 1 an | |
level.gd | il y a 7 mois | |
level.tscn | il y a 7 mois | |
project.godot | il y a 4 mois |
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
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.