gdquest-demos / godot-3-demos

Dozens of free and open source demos for the Godot game engine, version 3. Head to the link below for newer demos for Godot 4+
https://github.com/gdquest-demos/
MIT License
1.85k stars 978 forks source link

Third person controller added #47

Closed guilhermehto closed 5 years ago

guilhermehto commented 5 years ago

Opening as a draft as the camera is not yet ready.

Let me know what you think of the implementation and also the way the player "rotates".

There are two ways we can go about it:

  1. It moves forward and pressing left or right makes it rotate around its Y axis, thus, changing directions
  2. Pressing left makes it move to the left, up and left goes diagonally, etc.. This is how it's currently.

Tomorrow I should commit the camera if there are not many changes required.

ps: PRing here as we don't have any godot projects in the other repository.

NathanLovato commented 5 years ago

We should create a new repository for this, it's going to be a standalone controller. I'll create a repo and ping you again so you can push your PR there.

Let me know what you think of the implementation and also the way the player "rotates".

The code and the character's feel are off. You shouldn't convert vectors to strings and compare them to apply hard-coded rotations. The movement code shouldn't be absolute: it should be relative to the camera. But at least you can't code a character controller separately from its camera. I would personally have started with the base camera rig.

You should use vector calculations as much as possible, especially when setting the character's angle. Never use lerp to calculate motion.

For the movement, we should use root motion. I'll have to check if the root motion is in the exported character though.

There's quite a bit to review and change. I'll create a new repository and write down more precise requirements because it's not starting well.

NathanLovato commented 5 years ago

Could you please PR to this repo? I'll do the detailed review there: https://github.com/GDquest/godot-3d-mannequin

guilhermehto commented 5 years ago

Sure, no worries, though, the repository is empty - I'm not able to PR.

NathanLovato commented 5 years ago

I just added a readme, should be okay now