top of page

Control Yourself, Part Two

Will Hendrickson

Character controller input responsiveness

When designing your character system, there are two main factors that contribute to a responsive feel: animations and latency.

Latency in this context occurs when there is a perceived lag between input changes and character changes. For example, a melee attack will feel more responsive if it has less telegraphing time or wind-up at the start of the animation. Or, if the player releases a movement button or stick, we usually want the player to stop quite abruptly, with only a little bit of smoothing at the end of the motion. Some games add a stopping animation here, and if it's in your budget to add directional stopping animations, these will make the controller feel more responsive as well. This is one of the main reasons why a Rigidbody character controller implementation needs to control the drag coefficient dynamically: when the player is moving, reduce the drag to give the player more responsive direction changes. When the movement input passes into the deadzone, crank up the drag so that the character stops right away. You can also do this with the dynamic friction setting on the physic material for the collider, which is useful if you want the player to get bumped around more easily whilst airborne.

These manipulations aren't necessary with a Character Controller collider-based system, because the Move() command simulates the character's movement in an artificial way not constrained by physics. Some games instead use a very high friction or drag setting, and overcome it with extra force but this quickly creates an unrealistic physics interaction. This is one reason why it's easier to program a high-quality character controller using the Character Controller collider than it is to use a Rigidbody.

Another way we can make the character controller feel more responsive in third-person games is to animate the character when they collide with something. In Unity we can use animator layers to separate the top and bottom half of the character model and apply different animations to the player depending on what is currently happening. For example, if we have a Rigidbody character with a jetpack, when the character collides with a wall, we can send an animation trigger so that the character puts up their hand to block the collision. This is something we do in real life: when we collide with a wall, we put our arms in between our body and the obstacle, which helps protect us from injury.

In real life, we aren't pushed around by physics when we walk or run, instead the act is more like falling and constantly catching yourself. So, sine we don't want to simulate that we can keep this fact in mind when we're adjusting our controller settings: pedestrians in real life expect to start, stop and turn almost instantaneously, so our game character should, too. In fact, the game character should be more responsive than our own bodies because this will give a crisp and tight feel to the controls which is very satisfying to experience! In this way, we begin to enable fun through the simple act of movement.

 
bottom of page