This page looks best with JavaScript enabled

Rotating the Flight Controller - Lets Make a Side Scrolling Shooter - Part 2

 ·   ·  ☕ 1 min read

Lets make a visual upgrade for our basic flight controller we build in the last video. We’re going to make our ship rotate in the direction it is moving so its not just a cube moving up and down the screen!

To control the rotation we’ll add a fourth component to our flight controller that is designed specifically to handle this visual effect. It will read from the previously defined ShipInput and apply a smooth rotation to an “art” placeholder object. The smooth rotation is accomplished using a Quaternion.Slerp combined with the Time.deltaTime. This creates a a smooth curve towards the target angle that slows down the closer it gets to the target angle.

This video does a good job of demonstrating the different between a Lerp (Linear Interpolation) and a Slerp (Spherical Linear Interpolation):

The World of Zero Discord channel is open to anyone. You can join and talk software engineering, development and more:

Sam Wronski
Sam Wronski
Maker of things, currently helping build cloud things @ Google. World of Zero is a personal project disconnected from my professional work. Lets make something awesome together!