Making the player
First, you’re going to want to set up a platform for the player to stand on.
- Add a StaticBody3D as a child of Node3D.
- Add MeshInstance3D and CollisionShape3D as a child of StaticBody2D.
- In the inspector on the right side of the screen, set MeshInstance3D’s ‘Mesh’ property to New PlaneMesh. Set the CollisionShape3D’s ‘Shape’ property to New BoxShape3D.
- Select CollisionShape3D in the scene tree and use the orange dots to shape the BoxShape3D to the same shape and size as the plane.
- As a child of Node3D, add CharacterBody3D.
- Add as a child of CharacterBody3D add Camera3D and CollisionShape3D.
- Set the collision shape to capsule.
- Select the CharacterBody3D and move it up in the viewport until it’s on top of the plane.
- Move the camera up so it’s where the ‘head’ should be on the character.
- Give the CharacterBody3D a script and leave it as the default template script.
- One final step, add a DirectionalLight3D as a child of Node3D and rotate it to point down, this can be anywhere in the scene.
Phew! That was some setup, your scene should look something like this:
Now when you play the game and press down on the arrow keys you should move backwards off the platform and fall off, you should see the platform briefly as you fall.