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:
4 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.
Thank yee, this might prove useful indeed.
Are we allowed to use this code in our games?
It’s my pleasure, and I hope so, respectively!
As long as you’re in compliance with the license (see the repository for this), then it should be fine! Indeed, said license gives explicit permissions, I do believe.