5 minutes
TL;DR — The camera stops looking at the origin and starts following the falcon.
ChaseCameraTargetmarks the ship.ChaseCamera6DOFmoves the view behind and above the cockpit, and it rolls with the ship through every loop. New here: a chase smoother that uses an exponential blend, so it feels the same at any frame rate. It reads shared camera state instead of the bus. The ship needs a moving view before Lesson 7 adds dust for your speed to rush past.
Catching up?
Dropping in at this lesson? One command reinstalls the library components the build uses so far and writes the scene as it stood at the end of the previous lesson to public/scenes/WingmanFlight1-lesson-6/scene.json:
Copy that scene.json over your src/scenes/wingman.json and you are caught up to the start of this lesson.
Speed up and the falcon slides out of the frame. The camera you placed in Lesson 1 has not moved since then. It still sits at the origin, looking at where the ship used to be. On the ground, a camera can point at the horizon to find which way is up. Deep space has no horizon. So the camera has to follow the cockpit itself, and roll with it through every loop.
Two components do the job. The Player gets a marker that means follow me. The Camera gets the settings for how tightly to follow. Add ChaseCameraTarget: {} to the Player's components. Then add the chase block to the Camera, next to the CameraState6DOF from Lesson 1:
Continue reading
Unlock the Full Course
Every lesson, the runnable examples, and the finished build — yours to keep.