Version: 2022.1
언어: 한국어


class in UnityEngine


다음으로부터 상속:Collider

매뉴얼로 전환


A CharacterController allows you to easily do movement constrained by collisions without having to deal with a rigidbody.

A CharacterController is not affected by forces and will only move when you call the Move function. It will then carry out the movement but be constrained by collisions.

See Also: Character Controller component and Character animation examples


centerThe center of the character's capsule relative to the transform's position.
collisionFlagsWhat part of the capsule collided with the environment during the last CharacterController.Move call.
detectCollisionsDetermines whether other rigidbodies or character controllers collide with this character controller (by default this is always enabled).
enableOverlapRecoveryEnables or disables overlap recovery. Enables or disables overlap recovery. Used to depenetrate character controllers from static objects when an overlap is detected.
heightThe height of the character's capsule.
isGroundedWas the CharacterController touching the ground during the last move?
minMoveDistanceGets or sets the minimum move distance of the character controller.
radiusThe radius of the character's capsule.
skinWidthThe character's collision skin width.
slopeLimitThe character controllers slope limit in degrees.
stepOffsetThe character controllers step offset in meters.
velocityThe current relative velocity of the Character (see notes).

Public 함수

MoveSupplies the movement of a GameObject with an attached CharacterController component.
SimpleMoveMoves the character with speed.


OnControllerColliderHitOnControllerColliderHit is called when the controller hits a collider while performing a Move.

상속된 멤버


attachedArticulationBodyThe articulation body the collider is attached to.
attachedRigidbodyThe rigidbody the collider is attached to.
boundsThe world space bounding volume of the collider (Read Only).
contactOffsetContact offset value of this collider.
enabledEnabled Colliders will collide with other Colliders, disabled Colliders won't.
hasModifiableContactsSpecify whether this Collider's contacts are modifiable or not.
isTriggerIs the collider a trigger?
materialThe material used by the collider.
sharedMaterialThe shared physic material of this collider.
gameObjectThe game object this component is attached to. A component is always attached to a game object.
tagThe tag of this game object.
transformThe Transform attached to this GameObject.
hideFlagsShould the object be hidden, saved with the Scene or modifiable by the user?
nameThe name of the object.

Public 함수

ClosestPointReturns a point on the collider that is closest to a given location.
ClosestPointOnBoundsThe closest point to the bounding box of the attached collider.
RaycastCasts a Ray that ignores all Colliders except this one.
BroadcastMessageCalls the method named methodName on every MonoBehaviour in this game object or any of its children.
CompareTagChecks the GameObject's tag against the defined tag.
GetComponentReturns the component of type if the GameObject has one attached.
GetComponentInChildrenReturns the Component of type in the GameObject or any of its children using depth first search.
GetComponentInParentReturns the Component of type in the GameObject or any of its parents.
GetComponentsReturns all components of Type type in the GameObject.
GetComponentsInChildrenReturns all components of Type type in the GameObject or any of its children. Works recursively.
GetComponentsInParentReturns all components of Type type in the GameObject or any of its parents.
SendMessageCalls the method named methodName on every MonoBehaviour in this game object.
SendMessageUpwardsCalls the method named methodName on every MonoBehaviour in this game object and on every ancestor of the behaviour.
TryGetComponentGets the component of the specified type, if it exists.
GetInstanceIDGets the instance ID of the object.
ToStringReturns the name of the object.

정적 함수

DestroyRemoves a GameObject, component or asset.
DestroyImmediateDestroys the object obj immediately. You are strongly recommended to use Destroy instead.
DontDestroyOnLoadDo not destroy the target Object when loading a new Scene.
FindObjectOfTypeReturns the first active loaded object of Type type.
FindObjectsOfTypeGets a list of all loaded objects of Type type.
InstantiateClones the object original and returns the clone.


boolDoes the object exist?
operator !=Compares if two objects refer to a different object.
operator ==Compares two object references to see if they refer to the same object.


OnCollisionEnterOnCollisionEnter is called when this collider/rigidbody has begun touching another rigidbody/collider.
OnCollisionExitOnCollisionExit is called when this collider/rigidbody has stopped touching another rigidbody/collider.
OnCollisionStayOnCollisionStay is called once per frame for every Collider or Rigidbody that touches another Collider or Rigidbody.
OnTriggerEnterWhen a GameObject collides with another GameObject, Unity calls OnTriggerEnter.
OnTriggerExitOnTriggerExit is called when the Collider other has stopped touching the trigger.
OnTriggerStayOnTriggerStay is called almost all the frames for every Collider other that is touching the trigger. The function is on the physics timer so it won't necessarily run every frame.