Introduction to character control
Overview of the concepts and fundamental behaviors of character controllers.
読み終わるまでの所要時間 1 分最終更新 9時間前
A Character Controller lets a character follow floors, stop at walls, and push Rigidbody objects without realistic momentum or acceleration from incoming collisions.
The character in a first- or third-person game usually needs some collision-based physics so that it doesn't fall through the floor or walk through walls. In many applications, character acceleration and movement don't follow realistic physics. As a result, the character can accelerate, brake, and change direction almost instantly, and momentum doesn't affect its movement.
How character controllers work
In 3D physics, you can create this type of behavior with a . This component gives the character a simple, capsule-shaped collider that's always upright. The controller has its own special functions to set the object's speed and direction. But unlike true colliders, a rigidbody isn't needed and the momentum effects aren't realistic.
Character Controller
?
A character controller can't walk through static colliders, so it follows floors and stops at walls. To make the controller push Rigidbody objects aside as it moves, implement the behavior in a script. Incoming collisions don’t accelerate the character. You can use standard 3D colliders to create a scene around which the controller walks, but you're not limited by realistic physical behavior on the character itself.