SmoothFollow Unity Script improvements?


It is difficult to explain this, but i’ll give it a go. The SmoothFollow Unity script is good, but glitchy. I haven’t really invested the time into proper rotations and ways of making it better, but I am on a tight schedule, so any help is appreciated.

The Problem

The problem cant be explained easily in words alone, so I have a few pictures to try to help visualise the problem:

This is an image of the intended follow of the camera, in which it correctly follows the rotations of the ship whilst banking up or down. The camera target is actually an empty gameobject which is a child to the main ship object, which is situated above the ship for a better angle.

In this image you can see the top of the ship. This next picture is what actually happens when I bank downwards:

As you can see, the underside of the ship is showing, rather than the top region. The camera alone being fixed is not enough, I need a SmoothFollow camera because of the limitations of this game, but it has to rotate properly, almost as a whole with the ship. If you don’t understand fully feel free to leave a comment first. And help is appreciated.

You might wanna ditch the SmoothFollow script and create your own. Then it’ll do exactly what you need, and nothing you don’t.

In cinematography, cameras are often mounted to complex machines which can dolly, pivot, etc, and have the necessary range of motion to achieve a shot. Mimic this idea with an arrangement of empty game objects, and write code that drives only those properties of the “camera rig” that make sense. A camera rig is a powerful concept that’ll help you get any kind of complex behavior you need.