

On the other hand, if you want your player character to be affected by physics then you might be better off using a Rigidbody instead of the Character Controller. If you want to push Rigidbodies or objects with the Character Controller, you can apply forces to any object that it collides with via the OnControllerColliderHit() function through scripting. The Controller does not react to forces on its own and it does not automatically push Rigidbodies away. It will slide along walls, walk up stairs (if they are lower than the Step Offset) and walk on slopes within the Slope Limit. The Controller will then carry out the movement but be constrained by collisions A collision occurs when the physics engine detects that the colliders of two GameObjects make contact or overlap, when at least one has a Rigidbody component and is in motion. More info See in Glossary which can be told to move in some direction from a script. A collider doesn’t need to be exactly the same shape as the object’s mesh - a rough approximation is often more efficient and indistinguishable in gameplay. It is simply a capsule shaped Collider An invisible shape that is used to handle physical collisions for an object. The solution is the specialized Character Controller. Because it is so unrealistic, use of Rigidbodies and physics to create this behavior is impractical and will feel wrong. The character runs 90 miles per hour, comes to a halt immediately and turns on a dime. The traditional Doom-style first person controls are not physically realistic. Changing this will scale the collider along the Y axis in both positive and negative directions. The Character’s Capsule Collider A capsule-shaped collider component that handles collisions for GameObjects like barrels and character limbs. This is essentially the width of the collider. This will offset the Capsule Collider in world space, and won’t affect how the Character pivots. In most situations this value should be left at 0. If the character tries to move below the indicated value, it will not move at all. A good setting is to make this value 10% of the Radius.
Unity 5.3.6f1 skin#
Low Skin Width can cause the character to get stuck. Two colliders can penetrate each other as deep as their Skin Width. This should not be greater than the Character Controller’s height or it will generate an error. The character will step up a stair only if it is closer to the ground than the indicated value. Limits the collider to only climb slopes that are less steep (in degrees) than the indicated value. The Character Controller is mainly used for third-person or first-person player control that does not make use of Rigidbody A component that allows a GameObject to be affected by simulated gravity and other forces.
