Hi, maybe a basic question but ive seen multiple ways to add a character controller and dont know the best way. Eg. The built in character controller component or using kinematic or dynamic rigidbodies, but which one is best practice/ industry standard to use? Also which one would be the easiest to implement? Thank you in advance.
There is no single best character controller for all types of games. That’s why there are multiple methods provided.
As kdg notes, we have multiple ways because games are all different.
If you just need a simple FPS, here’s one:
That one has run, walk, jump, slide, crouch… it’s crazy-nutty!!
Hey,
there’s 2 main methods for implementing movement (there’s more complex but we’re talking in unity general) Rigidbody and character controller. as always both have pros and cons.
it’s as follows (from my humble experience of course):
Rigidbody(rb): can naturally interact with all physics, more used by game devs and industries, more customizable, more complex and advanced than character controller.
Character controller(cc): can naturally move on ground, slopes and can walk up stairs, more used by beginners cuz it’s straight forward and easy to understand, limited customization (still can implement anything in a way but a bit harder than rb).
implementation: rb are more used in parkour games or games with fluid movement and those with player’s physics interacting with environments. cc is more used in any other game that do not require player’s physics for interaction, and is used commonly for general games like puzzles, idle, rpg and so on.
Pick the game then the movement method.
Hope that helps.
Best wishes
Rigidbodies are a great tool, but they can be a liability as well. They are fully automatic and controlled by the physics engine, by (most-likely) there will be situations where the physics engine will not do what you want and you’ll have to step-in and solve these scenarios.
If you were making something like a walking simulator or a Final Fantasy styled RPG, for example, then using rigidbodies over a CharacterController-based solution will add complexity but probably no benefit.
Also, don’t forget that the the none-of-the-above controller solution is also a popular choice. This is where you use neither a rigidbody nor CharacterController. Instead you use physics collision test functions to handle all of your collision. Usually raycasts.