A Simple Third-Person Camera Controller

Apropos of the recent discussion of providing new samples for the engine, I’ve put together a simple third-person camera controller.

Now, I don’t often play games that use this sort of camera, I fear, so it’s very possible that there are cases that I’ve missed. And, well, it is a simple implementation.

Nevertheless, perhaps it might prove useful!

It also comes with a very simple demo-program, showing how the camera works.

You should find both the controller and the demo in this repository:

3 Likes

Why didnt you make it controlled by mouse? I think most people would like to do that.

Note that the controls are only implemented in the test-game; not in the actual camera-controller.

I think that my view at the time was that the game’s control-scheme is up to the dev, and not really part of the snippet that I was offering. Two different games might both use such a third-person camera as this, but have very different control-schemes.

Of course, some sort of control-mechanic was called for in the test-game, so I just implemented something quick and easy: keyboard controls. Devs making their own games with this controller can do otherwise, or likewise, as they prefer.