Practical sessions
Here are some additions you could make to the code:
- Add a more complete gravity.
Instead of just manipulating the vertical position of the instances, use a more complex way to apply gravity by using vertical acceleration. Since gravity is used in two places, in the instance for the speed and in the renderer for the collision detection, synchronization between both code parts is needed.
- Add collision detection for the third-person camera.
In real games, the camera is also a normal object in the virtual world. And instead of clipping through the level data, the camera always stays inside the same boundaries as the character it follows, connected by a spring arm structure to allow adjustments if the camera is unable to keep the exact position behind the character. You can try to add a bounding box for the third-person camera and check the boundaries against the level octree too. Remember to also check and change the distance...