Humanoid
Controls character health, movement, animation, and movement states.
- Creatable
Instance.new("Humanoid")- Inherits
- Instance
- Replication
- Standard
Behavior
Humanoid controls a character model's health, movement, and animation. Player
characters contain a Humanoid. NPC models can also use a Humanoid when
configured with the required character parts.
Summary
Whether the character automatically jumps over small obstacles.
Whether the character automatically turns toward its movement direction.
Whether character joints are broken when the humanoid dies.
The camera offset relative to the character's head.
The collision-box configuration used by the character.
The distance policy used for the character's name and health displays.
The display name used for the player or character.
The material of the surface currently supporting the character.
The current health, clamped between 0 and MaxHealth.
The maximum distance for the character's health display, in studs.
Whether the health display is always visible, hidden, or shown when damaged.
The vertical offset above the ground used to position the character.
Set to true to request a jump.
The requested jump height, in studs.
The jump strength used when UseJumpPower is enabled.
The maximum health, clamped to at least 0.
The maximum walkable slope angle in degrees, clamped to 0 through 89.9.
The read-only movement direction in world space.
The maximum distance for the character's name display, in studs.
The occlusion policy used for the character's name display.
Whether normal standing and movement controls are disabled.
Whether the character requires a valid neck joint.
The character's rig layout.
The BasePart used as the character's movement root, or nil when unavailable.
Whether the character is sitting.
Whether jumping uses the jump-power setting rather than jump height.
The walking speed in studs per second, clamped to at least 0.
The part relative to which WalkToPoint is interpreted.
The target position used by MoveTo.
Applies the supplied HumanoidDescription to the character.
Requests a transition to the specified humanoid state.
Equips the supplied Tool on the character.
Returns the character's currently applied HumanoidDescription.
Returns the Tools currently equipped by the character.
Returns this instance if it is an ExecutionGroup.
Returns an array of animation tracks currently playing on the humanoid.
Returns the animation graph players currently playing on this animator.
Returns the current Enum.HumanoidStateType value.
Returns whether the specified state is enabled.
Loads an Animation and returns an AnimationTrack.
Loads an AnimationGraph and returns an AnimationGraphPlayer.
Requests movement toward a position using WalkSpeed and collision handling.
Enables or disables entry into the specified humanoid state.
Subtracts a nonnegative amount from Health, down to 0.
Moves the character's equipped Tools back to its Backpack.
Fires when an animation track starts playing.
Fires when the Humanoid's climbing state changes.
Fires when Health reaches 0.
Fires when the Humanoid's falling-down state changes.
Fires when the Humanoid's freefall state changes.
Fires when the Humanoid's getting-up state changes.
Fires when Health changes.
Fires when the Humanoid's jumping state changes.
Fires when a MoveTo request finishes.
Fires when the Humanoid's platform-standing state changes.
Fires when the Humanoid's ragdoll state changes.
Fires when the Humanoid running state or speed changes.
Fires when the Humanoid's seated state changes.
Fires when the movement state changes.
Fires when the Humanoid's strafing state changes.
Fires when the Humanoid's swimming state changes.
Properties
AutoJumpEnabled
Humanoid.AutoJumpEnabled: booleanWhether the character automatically jumps over small obstacles.
AutoRotate
Humanoid.AutoRotate: booleanWhether the character automatically turns toward its movement direction.
BreakJointsOnDeath
Humanoid.BreakJointsOnDeath: booleanWhether character joints are broken when the humanoid dies.
CameraOffset
Humanoid.CameraOffset: Vector3The camera offset relative to the character's head.
CollisionType
Humanoid.CollisionType: EnumItemThe collision-box configuration used by the character.
DisplayDistanceType
Humanoid.DisplayDistanceType: EnumItemThe distance policy used for the character's name and health displays.
DisplayName
Humanoid.DisplayName: stringThe display name used for the player or character.
FloorMaterial
Humanoid.FloorMaterial: EnumItemThe material of the surface currently supporting the character.
Health
Humanoid.Health: numberThe current health, clamped between 0 and MaxHealth. A transition from positive health to 0 kills the humanoid and fires Died.
HealthDisplayDistance
Humanoid.HealthDisplayDistance: numberThe maximum distance for the character's health display, in studs.
HealthDisplayType
Humanoid.HealthDisplayType: EnumItemWhether the health display is always visible, hidden, or shown when damaged.
HipHeight
Humanoid.HipHeight: numberThe vertical offset above the ground used to position the character.
Jump
Humanoid.Jump: booleanSet to true to request a jump. The engine resets the property when the jump starts.
JumpHeight
Humanoid.JumpHeight: numberThe requested jump height, in studs.
JumpPower
Humanoid.JumpPower: numberThe jump strength used when UseJumpPower is enabled. Assignments are clamped to 0 through 1000.
MaxHealth
Humanoid.MaxHealth: numberThe maximum health, clamped to at least 0. Lowering it also reduces Health if the current health exceeds the new maximum. Raising it does not heal the character.
MaxSlopeAngle
Humanoid.MaxSlopeAngle: numberThe maximum walkable slope angle in degrees, clamped to 0 through 89.9.
MoveDirection
Humanoid.MoveDirection: Vector3The read-only movement direction in world space. Returns a unit vector while moving or a zero vector when stationary.
NameDisplayDistance
Humanoid.NameDisplayDistance: numberThe maximum distance for the character's name display, in studs.
NameOcclusion
Humanoid.NameOcclusion: EnumItemThe occlusion policy used for the character's name display.
PlatformStand
Humanoid.PlatformStand: booleanWhether normal standing and movement controls are disabled. Physics continues to affect the character.
RequiresNeck
Humanoid.RequiresNeck: booleanWhether the character requires a valid neck joint.
RigType
Humanoid.RigType: EnumItemThe character's rig layout.
RootPart
Humanoid.RootPart: BasePart? = nilThe BasePart used as the character's movement root, or nil when unavailable.
Sit
Humanoid.Sit: booleanWhether the character is sitting. Set to false to request standing.
UseJumpPower
Humanoid.UseJumpPower: booleanWhether jumping uses the jump-power setting rather than jump height.
WalkSpeed
Humanoid.WalkSpeed: numberThe walking speed in studs per second, clamped to at least 0. A value of 0 stops walking but does not disable physics.
WalkToPart
Humanoid.WalkToPart: BasePart?The part relative to which WalkToPoint is interpreted. Movement follows this part as it moves.
WalkToPoint
Humanoid.WalkToPoint: Vector3The target position used by MoveTo.
Methods
ApplyDescription
Humanoid:ApplyDescription(humanoidDescription: HumanoidDescription): ()Applies the supplied HumanoidDescription to the character.
ChangeState
Humanoid:ChangeState(state: EnumItem): ()Requests a transition to the specified humanoid state.
EquipTool
Humanoid:EquipTool(tool: Tool): ()Equips the supplied Tool on the character.
GetAppliedDescription
Humanoid:GetAppliedDescription(): HumanoidDescriptionReturns the character's currently applied HumanoidDescription.
GetEquippedTools
Humanoid:GetEquippedTools(): tableReturns the Tools currently equipped by the character.
GetExecutionGroup
Humanoid:GetExecutionGroup(): ExecutionGroup?Returns this instance if it is an ExecutionGroup. Otherwise returns the nearest ancestor ExecutionGroup, or nil when no group contains the instance.
GetPlayingAnimationTracks
Humanoid:GetPlayingAnimationTracks(): tableReturns an array of animation tracks currently playing on the humanoid.
GetPlayingGraphs
Humanoid:GetPlayingGraphs(): { AnimationGraphPlayer }Returns the animation graph players currently playing on this animator.
GetState
Humanoid:GetState(): EnumItemReturns the current Enum.HumanoidStateType value.
GetStateEnabled
Humanoid:GetStateEnabled(state: EnumItem): booleanReturns whether the specified state is enabled.
LoadAnimation
Humanoid:LoadAnimation(animation: Animation): AnimationTrackLoads an Animation and returns an AnimationTrack. Reuse the track to avoid repeated loading.
LoadGraph
Humanoid:LoadGraph(graph: AnimationGraph): AnimationGraphPlayerLoads an AnimationGraph and returns an AnimationGraphPlayer.
MoveTo
Requests movement toward a position using WalkSpeed and collision handling. An optional part makes the target relative to that part. MoveToFinished reports success or failure. This method does not teleport the character.
SetStateEnabled
Humanoid:SetStateEnabled(state: EnumItem, enabled: boolean): ()Enables or disables entry into the specified humanoid state.
TakeDamage
Humanoid:TakeDamage(amount: number): ()Subtracts a nonnegative amount from Health, down to 0. Negative amounts are treated as 0. The current implementation does not check ForceField protection.
UnequipTools
Humanoid:UnequipTools(): ()Moves the character's equipped Tools back to its Backpack.
Events
AnimationPlayed
Humanoid.AnimationPlayed: RBXScriptSignalFires when an animation track starts playing.
Climbing
Humanoid.Climbing: RBXScriptSignalFires when the Humanoid's climbing state changes.
Died
Humanoid.Died: RBXScriptSignalFires when Health reaches 0.
FallingDown
Humanoid.FallingDown: RBXScriptSignalFires when the Humanoid's falling-down state changes.
FreeFalling
Humanoid.FreeFalling: RBXScriptSignalFires when the Humanoid's freefall state changes.
GettingUp
Humanoid.GettingUp: RBXScriptSignalFires when the Humanoid's getting-up state changes.
HealthChanged
Humanoid.HealthChanged: RBXScriptSignalFires when Health changes. Passes the new health value.
Jumping
Humanoid.Jumping: RBXScriptSignalFires when the Humanoid's jumping state changes.
MoveToFinished
Humanoid.MoveToFinished: RBXScriptSignalFires when a MoveTo request finishes. Passes true if the destination was reached and false if the request timed out.
PlatformStanding
Humanoid.PlatformStanding: RBXScriptSignalFires when the Humanoid's platform-standing state changes.
Ragdoll
Humanoid.Ragdoll: RBXScriptSignalFires when the Humanoid's ragdoll state changes.
Running
Humanoid.Running: RBXScriptSignalFires when the Humanoid running state or speed changes.
Seated
Humanoid.Seated: RBXScriptSignalFires when the Humanoid's seated state changes.
StateChanged
Humanoid.StateChanged: RBXScriptSignalFires when the movement state changes. Passes the previous and new Enum.HumanoidStateType values.
Strafing
Humanoid.Strafing: RBXScriptSignalFires when the Humanoid's strafing state changes.
Swimming
Humanoid.Swimming: RBXScriptSignalFires when the Humanoid's swimming state changes.
Inherited members
- Properties
- ArchivableClassNameNameParent
- Methods
- AddComponent()AddTag()ClearAllChildren()ClearTags()Clone()Destroy()FindFirstAncestor()FindFirstAncestorOfClass()FindFirstAncestorWhichIsA()FindFirstChild()FindFirstChildOfClass()FindFirstChildWhichIsA()FindFirstDescendant()GetAttribute()GetAttributeChangedSignal()GetAttributes()GetChildren()GetComponent()GetComponentChangedSignal()GetComponents()GetDebugId()GetDescendants()GetFullName()GetPropertyChangedSignal()GetReferencing()GetTags()HasComponent()HasTag()IsA()IsAncestorOf()IsDescendantOf()RemoveComponent()RemoveTag()SetAttribute()WaitForChild()
- Events
- AncestryChangedAttributeChangedChangedChildAddedChildRemovedDescendantAddedDescendantRemovingDestroying
Examples
-- Requires a character model named Guard.
local character = workspace:WaitForChild("Guard")
local humanoid = character:WaitForChild("Humanoid")
humanoid.MaxHealth = 200
humanoid.Health = 200-- Server Script. Requires an NPC model named Guard with a Humanoid.
local Players = game:GetService("Players")
local guard = workspace:WaitForChild("Guard")
local humanoid = guard:WaitForChild("Humanoid")
local player = Players:GetPlayers()[1]
local character = player and player.Character
if character then
humanoid:MoveTo(character:GetPivot().Position)
end