PcoWSkbVqDnWTu_dm2ix
We use cookies on this site to enhance your user experience
Collapse Sidebar

Humanoid

Show deprecated

Humanoid

Show deprecated

The Humanoid is a special object that gives models the functionality of a character. It grants the model with the ability to physically walk around and interact with various components of a Roblox level.

Humanoids are always parented inside of a Model, and the model is expected to be an assembly of BasePart and Motor6D; the root part of the assembly is expected to be named HumanoidRootPart. It also expects a part named Head to be connected to the character’s torso part, either directly or indirectly.

By default, there are two official types of character rigs supplied by Roblox, each with their own set of rules:

R6

  • A basic character rig that uses 6 parts for limbs.
  • The Head part must be attached to a part named Torso, or the Humanoid will die immediately.
  • BodyPart appearances are applied using CharacterMesh objects.
  • Certain properties, such as Humanoid/LeftLeg and Humanoid/RightLeg, only work with R6.
  • R15

  • More complex than R6, but also far more flexible and robust.
  • Uses 15 parts for limbs.
  • The Head part must be attached to a part named UpperTorso or the Humanoid will die immediately.
  • BodyPart appearances have to be assembled directly.
  • Can be dynamically rescaled by using special NumberValue objects parented inside of the Humanoid.
    • The Humanoid will automatically create Vector3Value objects named OriginalSize inside of each limb.
    • If a NumberValue is parented inside of the Humanoid and is named one of the following, it will be used to control the scaling functionality:
      • BodyDepthScale
      • BodyHeightScale
      • BodyWidthScale
      • HeadScale
  • Properties

    bool

    AutoJumpEnabled

    Sets whether the character will automatically jump when they hit an obstacle as a player on a mobile device.

    bool

    AutoRotate

    AutoRotate sets whether or not the Humanoid will automatically rotate to face in the direction they are moving in.

    bool

    AutomaticScalingEnabled

    Vector3

    CameraOffset

    An offset applied to the Camera’s subject position when its CameraSubject is set to this Humanoid.

    HumanoidDisplayDistanceType

    DisplayDistanceType

    Controls the distance behavior of the Humanoid’s name and health display.

    Material

    FloorMaterial

    [ReadOnly] [NotReplicated]

    Describes the type of Material that the Humanoid is currently standing on. If the Humanoid isn’t standing on anything, the value of this property will be Air.

    float

    Health

    [NotReplicated]

    The current health of the Humanoid, from 0 to MaxHealth.
    If the health value reaches 0, the Humanoid will die and its connecting joints will be removed.

    float

    HealthDisplayDistance

    Used in conjunction with the Humanoid's Humanoid/DisplayDistanceType property to either determine how far a player controlling this Humanoid can see another humanoid’s health bar, or how far this Humanoid’s health displays to other viewing players.

    HumanoidHealthDisplayType

    HealthDisplayType

    Controls when the Humanoid’s health bar is allowed to be displayed.

    float

    HipHeight

    Sets how many studs off the ground the Humanoid’s RootPart should be.

    bool

    Jump

    [NotReplicated]

    Whether the Humanoid is jumping. If set to true, it will cause the Humanoid to jump.

    float

    JumpPower

    Determines how much upwards force is applied to the humanoid when jumping.

    float

    MaxHealth

    The maximum value of a humanoid’s Health.

    float

    MaxSlopeAngle

    The maximum slope angle that a humanoid can walk on without slipping.
    This value is clamped between 0° and 89°.

    Vector3

    MoveDirection

    [ReadOnly] [NotReplicated]

    Describes the direction that the Humanoid is walking in, as a unit vector along the X/Z axis.

    float

    NameDisplayDistance

    Used in conjunction with the Humanoid’s DisplayDistanceType property to either determine how far a player controlling this Humanoid can see another humanoid’s name, or how far this Humanoid’s name displays to other viewing players.

    NameOcclusion

    NameOcclusion

    Controls whether a Humanoid’s name can be seen behind walls or other objects.

    bool

    PlatformStand

    When set to true on a humanoid, it will be put into a state where it cannot move.

    HumanoidRigType

    RigType

    Describes whether this character is utilizing the legacy R6 character rig, or the new R15 character rig.

    BasePart

    RootPart

    [ReadOnly] [NotReplicated]

    A reference to the Humanoid’s HumanoidRootPart.

    BasePart

    SeatPart

    [ReadOnly] [NotReplicated]

    A reference to the seat that a humanoid is currently sitting in, if any.

    bool

    Sit

    When set to true, forces the humanoid into a sitting state.

    Vector3

    TargetPoint

    Describes the 3D position where the Player controlling the Humanoid last clicked in the world while using a Tool.

    float

    WalkSpeed

    Describes the Humanoid’s maximum movement speed in studs/sec.

    BasePart

    WalkToPart

    A reference to a part whose position is trying to be reached by a humanoid.

    Vector3

    WalkToPoint

    The position that a humanoid is trying to reach, after a call to Humanoid/MoveTo is made.

    Inherited from Instance: Show Hide

    int

    DataCost

    [ReadOnly] [NotReplicated]
    The cost of saving the instance using data persistence.
    Instance

    Parent

    Determines the hierarchical parent of the `Instance`.
    bool

    RobloxLocked

    If true, the `Instance` and its descendants cannot be indexed or edited by a `Script` or `LocalScript` and will throw an error if it is attempted.
    string

    ClassName

    [ReadOnly] [NotReplicated]
    A read-only string representing the class this `Instance` belongs to.
    string

    Name

    A non-unique identifier of the `Instance`.
    bool

    Archivable

    Determines if an `Instance` can be cloned using `/Instance/Clone` or saved to file.

    Functions

    void

    AddAccessory ( Instance accessory )

    Attaches the specified Accessory to the Humanoid

    void

    BuildRigFromAttachments ( )

    Assembles a tree of Motor6D joints by attaching together Attachment objects in a Humanoid|Humanoid's character

    void

    ChangeState ( HumanoidStateType state )

    Causes the Humanoid to enter the given Enum/HumanoidStateType

    void

    EquipTool ( Instance tool )

    Makes the Humanoid equip the given Tool

    Array

    GetAccessories ( )

    Returns an array of Accessory|Accessories that the Humanoid is currently wearing

    BodyPartR15

    GetBodyPartR15 ( Instance part )

    Limb

    GetLimb ( Instance part )

    Returns the Enum/Limb enum that is associated with the given Part

    Array

    GetPlayingAnimationTracks ( )

    Returns an array of all AnimationTrack|AnimationTracks that are currently being played on the Humanoid

    HumanoidStateType

    GetState ( )

    Returns the Humanoid|Humanoid's current Enum/HumanoidStateType

    bool

    GetStateEnabled ( HumanoidStateType state )

    Returns whether a Enum/HumanoidStateType is enabled for the Humanoid

    Instance

    LoadAnimation ( Instance animation )

    Loads an Animation onto a Humanoid, returning an AnimationTrack that can be used for playback

    void

    Move ( Vector3 moveDirection , bool relativeToCamera )

    Causes the Humanoid to walk in the given direction

    void

    MoveTo ( Vector3 location , Instance part )

    Causes the Humanoid to attempt to walk to the given location by setting the Humanoid/WalkToPoint and Humanoid/WalkToPart properties

    void

    RemoveAccessories ( )

    Removes all Accessory|Accessories worn by the Humanoid

    bool

    ReplaceBodyPartR15 ( BodyPartR15 bodyPart , Instance part )

    void

    SetStateEnabled ( HumanoidStateType state , bool enabled )

    Sets whether a given Enum/HumanoidStateType is enabled for the Humanoid

    void

    TakeDamage ( float amount )

    Subtracts the damage from the health of the targeted humanoid unless the character has a ForceField.

    void

    UnequipTools ( )

    Unequips any Tool currently equipped by the Humanoid

    Inherited from Instance: Show Hide

    RBXScriptSignal

    GetPropertyChangedSignal ( string property )

    Get an event that fires when a given property of an object changes.
    Instance

    FindFirstChildWhichIsA ( string className , bool recursive )

    Returns the first child of the `Instance` for whom `Instance/IsA` returns true for the given className.
    Array

    GetDescendants ( )

    [CustomLuaState]
    Returns an array containing all of the `Instance`'s descendants.
    bool

    IsAncestorOf ( Instance descendant )

    Returns true if an `Instance` is an ancestor of the given descendant.
    bool

    IsDescendantOf ( Instance ancestor )

    Returns true if an `Instance` is a descendant of the given ancestor.
    Instance

    FindFirstChildOfClass ( string className )

    Returns the first child of the `Instance` whose `Instance/ClassName|ClassName` is equal to the given className.
    Instance

    FindFirstChild ( string name , bool recursive )

    Returns the first child of the `Instance` found with the given name.
    Instance

    FindFirstAncestorWhichIsA ( string className )

    Returns the first ancestor of the `Instance` for whom `Instance/IsA` returns true for the given className.
    Instance

    FindFirstAncestorOfClass ( string className )

    Returns the first ancestor of the `Instance` whose `Instance/ClassName` is equal to the given className.
    Instance

    FindFirstAncestor ( string name )

    Returns the first ancestor of the `Instance` whose `Instance/Name` is equal to the given name.
    bool

    IsA ( string className )

    Returns true if an `Instance`'s class matches or inherits from a given class
    Instance

    WaitForChild ( string childName , double timeOut )

    [CustomLuaState] [CanYield]
    Returns the child of the `Instance` with the given name. If the child does not exist, it will yield the current thread until it does.
    string

    GetFullName ( )

    Returns a string showing the `Instance`'s ancestry.
    string

    GetDebugId ( int scopeLength )

    [NotBrowsable]
    Returns a coded string of the `Instance`s DebugId used internally by Roblox.
    Objects

    GetChildren ( )

    Returns an array containing all of the `Instance`'s children.
    void

    Destroy ( )

    Sets the `Instance/Parent` property to nil, locks the `Instance/Parent` property, disconnects all connections and calls Destroy on all children.
    Instance

    Clone ( )

    Create a deep copy of a Roblox instance and descendants where `Archivable = true`.
    void

    ClearAllChildren ( )

    This function destroys all of an `Instance`'s children.

    Events

    RBXScriptSignal

    AnimationPlayed ( Instance animationTrack )

    Fires when an AnimationTrack begins playing on the Humanoid

    RBXScriptSignal

    Climbing ( float speed )

    Fires when the speed at which a Humanoid is climbing changes

    RBXScriptSignal

    Died ( )

    Fires when the Humanoid dies

    RBXScriptSignal

    FallingDown ( bool active )

    Fires when the Humanoid enters or leaves the FallingDown Enum/HumanoidStateType

    RBXScriptSignal

    FreeFalling ( bool active )

    Fires when the Humanoid enters or leaves the Freefall Enum/HumanoidStateType

    RBXScriptSignal

    GettingUp ( bool active )

    Fires when the Humanoid enters or leaves the GettingUp Enum/HumanoidStateType

    RBXScriptSignal

    HealthChanged ( float health )

    Fires when the Humanoid|Humanoid's Humanoid/Health changes to a value equal or below the Humanoid/MaxHealth value

    RBXScriptSignal

    Jumping ( bool active )

    Fires when the Humanoid enters and leaves the Jumping Enum/HumanoidStateType

    RBXScriptSignal

    MoveToFinished ( bool reached )

    Fires when the Humanoid finishes walking to a goal declared by Humanoid/MoveTo

    RBXScriptSignal

    PlatformStanding ( bool active )

    Fires when the Humanoid enters or leaves the PlatformStanding Enum/HumanoidStateType

    RBXScriptSignal

    Ragdoll ( bool active )

    Fires when the Humanoid enters or leaves the Ragdoll Enum/HumanoidStateType

    RBXScriptSignal

    Running ( float speed )

    Fires when the speed at which a Humanoid is running changes

    RBXScriptSignal

    Seated ( bool active , Instance currentSeatPart )

    Fired when a Humanoid either sits in a Seat or VehicleSeat or gets up

    RBXScriptSignal

    StateChanged ( HumanoidStateType old , HumanoidStateType new )

    Fired when the state of the Humanoid is changed

    RBXScriptSignal

    StateEnabledChanged ( HumanoidStateType state , bool isEnabled )

    Fires when Humanoid/SetStateEnabled is called on the Humanoid

    RBXScriptSignal

    Strafing ( bool active )

    Fires when the Humanoid enters or leaves the StrafingNoPhysics Enum/HumanoidStateType

    RBXScriptSignal

    Swimming ( float speed )

    Fires when the speed at which a Humanoid is swimming in Terrain water changes

    RBXScriptSignal

    Touched ( Instance touchingPart , Instance humanoidPart )

    Fires when one of the Humanoid|Humanoid's limbs come in contact with another BasePart

    Inherited from Instance: Show Hide

    RBXScriptSignal

    DescendantRemoving ( Instance descendant )

    Fires immediately before a descendant of the `Instance` is removed.
    RBXScriptSignal

    AncestryChanged ( Instance child , Instance parent )

    Fires when the `Instance/Parent` property of the object or one of its ancestors is changed.
    RBXScriptSignal

    ChildAdded ( Instance child )

    Fires when an object is parented to this `Instance`.
    RBXScriptSignal

    ChildRemoved ( Instance child )

    Fires when a child is removed from this `Instance`.
    RBXScriptSignal

    DescendantAdded ( Instance descendant )

    Fires when a descendant is added to the `Instance`.
    RBXScriptSignal

    Changed ( string property )

    Fired immediately after a property of an object changes.