Third person controller game

Hello! Can anyone please help me to make a third person control game? I don’t have any code so don’t ask for it. I just need a few example code snippets

Depending on what sort of third-person camera you’re interested it, my “Beginner’s Tutorial” might be of use to you:

It takes one through the building of a game, starting with some of the fundamentals of using the engine, through implementation of the game itself, and all the way to building a distributable.

And as it happens, the simple game that it builds up, step by step, is a third-person endless-survival arena-shooter. To be specific, it has a fixed-position, distant third-person camera, looking down on the arena and the characters.

That said, even if it’s not quite what you have in mind, you might find some elements to be applicable.

If you’re interested, you should find the tutorial here:

1 Like

In Addition to Thaumaturges Tutorial, you should also take a look at the manual which has all the necessary basic information you’d need to create whatever game you intend to make.
You may also be interested in those forum posts which

give you a fully working character controller with extensive third person camera

a collection of code snippets including scripts for various camera systems including third person ones

And of course my Panda3D book even though it doesn’t has a third person camera for a single character, it does describe how to work with the camera which is basically the same for any camera type you’d like to implement. And you may find other parts of it useful for other parts of your game.

1 Like

Thanks! I will check all of this out. As for the manuals, I just skim most of the pages and only read if it is interesting. I will check the manuals properly this time

1 Like

Your tutorial is nice, but I want the camera to be following the player a little behind. In your tutorial it shows the whole screen from above. That’s not what I want

That’s fair.

In that case, you might look through the “Code Snippets” sub-forum to which wolf linked above–there may well be some useful code in there!

Otherwise, exactly how such a thing is implemented might depend heavily on just how you want the camera to behave, and what constraints apply to it.

For example, a camera that holds close to the player might intersect with walls, potentially calling for some means of handling the occurrence. Conversely, a very distant camera–like the one in my tutorial, but following the player–might never get near to any walls, and thus might not require such logic. And so on.

Can you show me some code snippets. Here is a link to show you what I need

Based on a quick look at that video, the camera-handling is very simple–it doesn’t even account for the camera passing through terrain!

Something like that should be as simple as reparenting the camera to the player-character and applying an offset to its position and orientation, I believe.

As to finding snippets, you have access to the “Code Snippets” sub-forum–use either the forum’s search functionality or Google to look through it for items that may be of use to you.