As part of my work on Adventure in Hender Castle, I have been researching a lot about creating a good 3D character controller. In this post, I want to share some resources and thoughts on the process.
Initial Conclusions: Creating a GOOD 3D controller:
- It's difficult: Creating a good controller takes time and requires a willingness to work hard.
- Research references: Look for games that have controls similar to what you want to make, and compare videos of your controller with videos of your references. This is the best way to see how close (or far) you are from your goal.
- Iterate and playtest a lot: You need to make several iterations and playtest a lot until you get the desired result. It's best to start each iteration from scratch.
- Learn vector mathematics and some physics formulas: What is a vector? How do you add, subtract, multiply them? What is the dot product? How do you calculate velocity? Reviewing these four points closely is a great start. Let's now look at some supporting links and videos:
Unity 3D Game Kit
This Unity project is free on the Asset Store and lets you observe a 3D action-adventure game with several mechanics already implemented. If you are starting in game creation, it is a good starting point.
- It has a title screen and pause menus
- It has a basic melee combat system
- It has a configured controller with its animator. The project uses Root Motion to move the character, which means that the movement is handled by animations. This can work for certain types of games. But if you want to make a really precise controller, look at other options.
Unity Movement Tutorial by Cat-like Coding:
This series of tutorials covers creating a movement controller from scratch in Unity. I consider them advanced content due to the complexity of the calculations they perform, but if you want a complete understanding of generating movement in Unity, this is the best tutorial I have found.
Game Makers Tool Kit Game Essay
This project, half video game and half essay, is a great explanation of the concepts that need to be considered to generate movement in Unity. With an interactive explanation, the best part is that the project code and how it achieved its character's movement are available to everyone and explained on its own blog: Platformer Toolkit
Kinematic Character Controller:
This asset used to be paid and cost about 90 USD, but its creator made it free. It is a kinematic "character controller" package that deals with collision detection, moving platforms, and many other edge cases. In short, it is a better version of the character controller that comes with Unity.
It is not a complete solution. You need to write your own controller functionality on top of this package, such as receiving player input and calculating movement speed, so it is also advanced.
State Machines:
The last part of my research has to do with managing the player's "state" and the movement executed at each moment. What I found about this are State Machines for Characters. On YouTube, there are several explanations on how to build and use them. For example, this video:
The keywords to find this type of content are "state machine character controllers."
This is the summary of my current research. I hope it has been helpful!