June 2018
Beginner to intermediate
298 pages
7h 38m
English
There is one final improvement to the camera: making it follow the ball. Now that you have a stable, gimbaled camera, it will work great if the gimbal is set to follow the ball's position. Add this line to the Main scene's _process() function:
$GimbalOut.transform.origin = $Ball.transform.origin
Note that you shouldn't set the gimbal's transform to the ball's transform, or it will also rotate as the ball rolls!
Try the game now and observe how the camera tracks the ball's movement while still being able to rotate and zoom.
Read now
Unlock full access