Class · inherits Instance
Humanoid
A special object that gives models the functionality of a character.
About Humanoid
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 experience. 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
Headpart must be attached to a part namedTorso, or the Humanoid will die immediately. - BodyPart appearances are applied using
CharacterMeshobjects. - Certain properties, such as
Humanoid.LeftLegandHumanoid.RightLeg, only work with R6.
R15
- More complex than R6, but also far more flexible and robust.
- Uses 15 parts for limbs.
- The
Headpart must be attached to a part namedUpperTorsoor the Humanoid will die immediately. - BodyPart appearances have to be assembled directly.
- Can be dynamically rescaled by using special
NumberValueobjects parented inside of the Humanoid. - The Humanoid will automatically create
Vector3Valueobjects namedOriginalSizeinside 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 32
AutoJumpEnabled
: booleanSets whether the character will automatically jump when they hit an obstacle as a player on a mobile device.AutoJumpEnabled sets whether or not the
Humanoidwill attempt to automatically jump over an obstacle it is walking towards.Currently, this property only works when the following conditions are true:
- The Humanoid's character model is the
Player.Characterof aPlayer. - The Player in question is using touch controls.
When a player's character spawns, the property's value matches the player's
Player.AutoJumpEnabledproperty - which in turn matches theStarterPlayer.AutoJumpEnabledproperty.- The Humanoid's character model is the
AutomaticScalingEnabled
: booleanWhen Enabled, AutomaticScalingEnabled causes the size of the character to change in response to the values in the humanoid's child scale values changing.The Humanoid has six child scale values including
BodyDepthScale,BodyHeightScale,BodyProportionScale,BodyTypeScale,BodyWidthScale,HeadScale. Changing the value of any of these causes the character's body parts and accessories to change size, but only ifAutomaticScalingEnabledis true.AutoRotate
: booleanAutoRotate sets whether or not the Humanoid will automatically rotate to face in the direction they are moving in.The AutoRotate property describes whether or not the Humanoid will automatically rotate to face in the direction they are moving. When set to true, the character model will gradually turn to face their movement direction as the Humanoid walks around. When set to false, the character model will remain fixated in its current rotation, unless a rotating force is applied to the HumanoidRootPart.
If the character model happens to be the character of a player, then the behavior of the Humanoid's rotation is influenced by the UserGameSetting's RotateType property.
When the AutoRotate property is set to true, the RotateType property has the following effects on the Humanoid's rotation:
BreakJointsOnDeath
: booleanDetermines whether the humanoid's joints break when in theHumanoidStateType.Deadstate.Determines whether the humanoid's joints break when in the
HumanoidStateType.Deadstate. Defaults to true.CameraOffset
: Vector3An offset applied to the Camera's subject position when its CameraSubject is set to this Humanoid.The CameraOffset property specifies an offset to the camera's subject position when its
Camera.CameraSubjectis set to thisHumanoid.The offset is applied in object-space, relative to the orientation of the Humanoid's HumanoidRootPart. For example, an offset
Vector3value of (0, 10, 0) offsets the player's camera to 10 studs above the player's humanoid.DisplayDistanceType
: HumanoidDisplayDistanceTypeControls the distance behavior of the humanoid's name and health display.The DisplayDistanceType property controls the distance behavior of the humanoid's name and health display. This property is set using the
HumanoidDisplayDistanceTypeenum with three available values, each with their own set of rules:- When set to
Viewer, the humanoid sees the name/health of other humanoids within range of its ownNameDisplayDistanceandHealthDisplayDistance. - When set to
Subject, the humanoid takes full control over its own name and health display through itsNameDisplayDistanceandHealthDisplayDistancevalues. - When set to
None, the humanoid's name and health bar do not appear under any circumstances.
See Character Name/Health Display for an in-depth guide on controlling the appearance of character names and health bars.
- When set to
DisplayName
: stringSets the text of a Humanoid, displayed above their head.DisplayNameis a property that determines the Humanoid's name display when visible. By default, a new Humanoid will have the value of an empty string. IfDisplayNameis an empty string, the humanoid's name display will default to the humanoid's parent's name property.Player Character Loading
When players load their character, either automatically or through the use of
LoadCharacterAsync(), the Humanoid that is created by the engine will have itsDisplayNameproperty set to the player'sDisplayNameproperty.StarterCharacter and StarterHumanoid
When a
HumanoidnamedStarterHumanoidis parented toStarterPlayer, or when a Humanoid is present in a Model namedStarterCharacter, the DisplayName property will be respected when Characters are loaded by Players in the game. The engine will only override theDisplayNameproperty of the Humanoid with theDisplayNameproperty of the player if theHumanoid.DisplayNameofStarterHumanoidis an empty string.EvaluateStateMachine
: booleanUsed to disable the internal physics and state machine of the Humanoid.Used to disable the internal physics and state machine of the
Humanoid.What does turning this off do?
- No forces - The humanoid will not apply forces to any of its parts. The humanoid will not move the character in any way.
- No sensors - The humanoid will not run any spatial queries to detect floors, ladders, or other obstacles (such as auto-jump).
- No collision changes - The humanoid will not alter the collision
state of any of the character parts. By default, only the torso and head
have
Part.CanCollideenabled. - No state transitions or replication - The humanoid will not automatically update its state. You can still set humanoid state with a script, but it will not automatically replicate.
What does turning this off not do?
- State events - If manually setting humanoid states, the events for
each of the humanoid's states and
StateChangedwill still fire, which means the Animate script will still receive them and animate the character based on its current humanoid state. - Appearance -
HumanoidDescription, clothes, accessories and other humanoid rendering behavior. - Camera and player scripts - The humanoid is still linked to
Playersand camera scripts, which ensures the camera will continue to follow theHumanoid.RootPart. - Player input handling - The
Humanoid.MoveDirectionproperty will still be updated via theHumanoid.Movefunction andPlayerScriptsfor input.
FloorMaterial
: MaterialReadOnlyNotReplicatedDescribes theMaterialthat theHumanoidis currently standing on. If theHumanoidisn't standing on anything, the value of this property will be Air.This is a read-only property that describes the
MaterialtheHumanoidis currently standing on. It works with both regularPartsandTerrainvoxels.The code sample below demonstrates how to listen to when this property changes using
Object.GetPropertyChangedSignal. When the material the humanoid is standing on changes, it will print a message indicating the new material being stood on.local Humanoid = route.to.humanoid Humanoid:GetPropertyChangedSignal("FloorMaterial"):Connect(function() print("New value for FloorMaterial: " .. tostring(Humanoid.FloorMaterial)) end)Caveats
- When the
Humanoidis not standing on a floor, the value of this property will be set to Air.- This occurs because Enum properties cannot have an empty value.
- This can cause some confusion if a part has its material is set to Air, though in practice, parts are not supposed to use that material in the first place.
- The character model of the
Humanoidmust be able to collide with the floor, or else it will not be detected.- You cannot test if the
Humanoidis swimming with this property. You should instead use itsHumanoid.GetStatefunction.
- You cannot test if the
- When the
Health
: floatNotReplicatedDescribes the current health of the Humanoid on the range [0,Humanoid.MaxHealth].This property represents the current health of the
Humanoid. The value is restricted to the range between 0 andMaxHealth. If the humanoid is dead, this property is continually set to 0.Note that the
TakeDamage()function may be used to subtract fromHealthinstead of setting the property directly.Health Regeneration
By default, a passive health regeneration script is automatically inserted into humanoids. This causes non-dead player characters to regenerate 1% of
MaxHealtheach second. To disable this regeneration behavior, add an emptyScriptnamed Health toStarterCharacterScripts.Health Bar Display
When
Healthis less thanMaxHealth, a health bar is displayed in-experience. The display behavior of the health bar is dependent on theHealthDisplayDistanceandHealthDisplayType.See Character Name/Health Display for an in-depth guide on controlling the appearance of character names and health bars.
Death
When the value of the character's health reaches 0, the
Humanoidautomatically transitions to theHumanoidStateType.Deadstate. In this state,Healthis locked to 0; however, there is no error or warning for setting theHealthof a dead humanoid to a positive nonzero value.HealthDisplayDistance
: floatUsed in conjunction with theDisplayDistanceTypeproperty to control the distance from which a humanoid's health bar can be seen.This property is a number used in conjunction with the
DisplayDistanceTypeproperty to control the distance from which a humanoid's health bar can be seen.See Character Name/Health Display for an in-depth guide on controlling the appearance of character names and health bars.
HealthDisplayType
: HumanoidHealthDisplayTypeControls when the humanoid's health bar is allowed to be displayed.This property controls when a humanoid's health bar is allowed to be displayed. By default, this property is set to
DisplayWhenDamaged, which makes the health bar only display when a humanoid'sHealthis less than itsMaxHealth. It can also be set toAlwaysOn, which makes the health bar always display, orAlwaysOff, which prevents it from ever displaying.Note that this property functions independently of the humanoid's
HealthDisplayDistanceproperty which is responsible for making the health bar fade out at certain distances. IfHumanoid.HealthDisplayType|HealthDisplayTypeis set toAlwaysOn, it will still fade out depending the howHealthDisplayDistanceis configured.See Character Name/Health Display for an in-depth guide on controlling the appearance of character names and health bars.
HipHeight
: floatDetermines the distance off the ground theHumanoid.RootPartshould be.Determines the distance (in studs) off the ground the
RootPartshould be when the humanoid is standing. TheRigTypeinfluences the way this property behaves.For R15 rigs, a suitable hip height is preset to ensure the height of the
RootPartis correct. The height of the legs is not used. The overall height of the humanoid can be described in the following formula:Height = (0.5 * RootPart.Size.Y) + HipHeightFor R6 rigs,
HipHeightinstead describes a relative offset. The overall height of the humanoid can be described in the following formula:Height = LeftLeg.Size.Y + (0.5 * RootPart.Size.Y) + HipHeightJump
: booleanNotReplicatedIftrue, theHumanoidjumps with an upwards force.If
true, theHumanoidjumps with an upwards force equal to the value ofHumanoid.JumpPoweror the height ofHumanoid.JumpHeight, depending on the value ofHumanoid.UseJumpPower.JumpHeight
: floatProvides control over the height that theHumanoidjumps to.Provides control over the height a
Humanoidjumps, in studs. The starting value of this property is determined by the value ofStarterPlayer.CharacterJumpHeightwhich defaults to 7.2.Although setting this property to 0 will effectively prevent the humanoid from jumping, it's recommended to disable jumping by disabling the
HumanoidStateType.Jumpingstate throughHumanoid.SetStateEnabled.This property is only visible in the Properties window if
Humanoid.UseJumpPoweris set to false, as it is not relevant otherwise (instead,Humanoid.JumpPoweris used).JumpPower
: floatDetermines how much upwards force is applied to theHumanoidwhen jumping.Determines how much upwards force is applied to the
Humanoidwhen jumping. The starting value of this property is determined by the value ofStarterPlayer.CharacterJumpPowerwhich defaults to 50 and is constrained between 0 and 1000. Note that jumps are also influenced by theWorkspace.Gravityproperty which determines the acceleration due to gravity.Although setting this property to 0 will effectively prevent the humanoid from jumping, it's recommended to disable jumping by disabling the
HumanoidStateType.Jumpingstate throughHumanoid.SetStateEnabled.This property is only visible in the Properties window if
Humanoid.UseJumpPoweris set to true, as it is not relevant otherwise (instead,Humanoid.JumpHeightis used).MaxHealth
: floatThe maximum value of a humanoid'sHealth.The maximum value of a humanoid's
Health.The value of this property is used alongside the
Healthproperty to size the default health bar display. When a humanoid'sHealthreachesMaxHealth, its health bar may not be displayed, depending on itsHealthDisplayTypeproperty.MaxSlopeAngle
: floatThe maximum slope angle that a humanoid can walk on without slipping.This property determines the maximum slope angle that a humanoid can climb. If the angle of a slope is greater than a humanoid's MaxSlopeAngle, they will slide down the slope.
When a character spawns, this property is set according to the value of
StarterPlayer.CharacterMaxSlopeAngle.The value of this property is constrained to values between 0° and 89°. It defaults to 89°, so humanoids can climb pretty much any slope they want by default.
MoveDirection
: Vector3ReadOnlyNotReplicatedDescribes the direction that theHumanoidis walking in.MoveDirection is a read-only property that describes the direction a
Humanoidis walking in, as a unit vector or zero length vector. The direction is described in world space.Because this property is read-only, it cannot be set by a
ScriptorLocalScript.NameDisplayDistance
: floatUsed in conjunction with theHumanoid.DisplayDistanceTypeproperty to control the distance from which a humanoid's name can be seen.The NameDisplayDistance property is a number used in conjunction with the
Humanoid.DisplayDistanceTypeproperty to control the distance from which a humanoid's name can be seen.See Character Name/Health Display for an in-depth guide on controlling the appearance of character names and health bars.
NameOcclusion
: NameOcclusionControls whether a humanoid's name and health bar can be seen behind walls or other objects.Controls whether a humanoid's name and health bar can be seen behind walls or other objects. This property is a
NameOcclusionvalue and can be configured to occlude all names, enemy names, or disable occlusion entirely.In cases where the
LocalPlayerhas noHumanoidassociated with it, this property instead applies to the subjectHumanoid.See Character Name/Health Display for an in-depth guide on controlling the appearance of character names and health bars.
PlatformStand
: booleanDetermines whether theHumanoidis currently in theHumanoidStateType.PlatformStandingstate.Determines whether the
Humanoidis currently in theHumanoidStateType.PlatformStandingstate. When true, the Humanoid is in a state where it is free-falling and cannot move. This state behaves similar to sitting, except that jumping does not free the humanoid from the state.RequiresNeck
: booleanAllows developers to disable the behavior where a playerCharacter|characterdies if the NeckMotor6Dis removed or disconnected even momentarily.Allows developers to disable the behavior where a player
Character|characterdies if the NeckMotor6Dis removed or disconnected even momentarily. This property defaults to true.RigType
: HumanoidRigTypeDescribes whether thisHumanoidis utilizing the legacy R6 character rig, or the new R15 character rig.RigType describes whether a
Humanoidis utilizing the legacy R6 character rig, or the newer R15 character rig.The R6 rig uses 6 visible
Partswhile the R15 rig uses 15 visibleParts. R15 rigs have more joints than R6 rigs, making them much more versatile when being animated.Note that if this property is set incorrectly, the
Humanoidwill not function correctly. For example, if a R15 humanoid's RigType is set to R6, theHumanoidwill die as there is noBasePartcalled Torso connected to aBasePartcalled Head.RootPart
: BasePartReadOnlyNotReplicatedA reference to the humanoid'sHumanoidRootPartobject.A reference to the humanoid's
HumanoidRootPartobject. TheHumanoidRootPartis required for all assemblies that include aHumanoidand is the primary driving part of theHumanoidthat controls a humanoid's movement through the 3D world. This part is normally invisible and typically resides in the local origin center of the character model.The
HumanoidRootPartis included in all platform-wide avatar characters, and automatically created when a character model is imported into Studio. It's possible to manually add aHumanoidRootPartto a model by adding aPartnamedHumanoidRootPartand ensuring it's the root part of the assembly.Use this property to reference the specific
HumanoidRootPartwithout searching the model hierarchy. You can get or set theCFrameof this part to change position or reorient the entire character model.For R15 or higher-fidelity characters, the
Model.PrimaryPartof thePlayer.Charactermodel is also set toHumanoidRootPart.While R6 characters also include a
HumanoidRootPart, the R6 characters,Model.PrimaryPartis set to theHeadpart.SeatPart
: BasePartReadOnlyNotReplicatedA reference to the seat that aHumanoidis currently sitting in, if any.SeatPart is a reference to the seat that a
Humanoidis currently sitting in, if any. The value of this property can be either aSeat, or aVehicleSeat. It will be nil if the Humanoid is not currently sitting in a seat.Note:
- For a bool describing if the
Humanoidis currently sitting or not, seeHumanoid.Sit
- For a bool describing if the
Sit
: booleanDescribes whether theHumanoidis currently sitting.The Sit property is a boolean that indicates whether the
Humanoidis currently sitting.Humanoidscan be forced into a sitting state by setting this property's value to true. If theHumanoidisn't attached to a seat while in its sitting state, it will trip over with no collision in its legs. AHumanoidcan escape from the sitting state by jumping.Note:
- The
SeatorVehicleSeattheHumanoidis sitting on can be obtained using theHumanoid.SeatPartproperty - It is possible to detect when a Humanoid sits by connecting to the
Humanoid.Seatedevent.
- The
TargetPoint
: Vector3Describes the 3D position where thePlayercontrolling theHumanoidlast clicked in the world while using aTool.Do not use This property only works with Experimental Mode enabled, which has been entirely discontinued.
This property describes a 3D position in space where the
Playercontrolling thisHumanoidlast clicked with aToolequipped.This property is primarily used by classic tools to determine what a humanoid is targeting when they activate a tool. If you give an NPC a classic rocket launcher, set their TargetPoint, and then call the tool's
Tool.Activatefunction, you can make the NPC fire a rocket at the target point.UseJumpPower
: booleanDetermines whether theJumpHeight(false) orHumanoid.JumpPower(true) property is used.When a character spawns, this property is set according to the value of
StarterPlayer.CharacterUseJumpPower, which defaults to true.When jumping, with this set to false, the
Humanoid.JumpHeightvalue is used to ensure the humanoid jumps to that height. With this set to true, theHumanoid.JumpPowervalue is used to apply an upward force.WalkSpeed
: floatDescribes the humanoid's maximum movement speed in studs per second.This property describes how quickly the
Humanoidis able to walk, in studs per second. It defaults to the value ofStarterPlayer.CharacterWalkSpeed(16), meaning a player character can move 16 studs in any direction each second.Notes
- When controlled on a mobile device or a gamepad, a humanoid can walk
slower than its
WalkSpeedif the controlling thumbstick is moved just a gradual degree from center. - You can freeze a humanoid in place by setting
WalkSpeedto0, effectively preventing the controlling player from moving it through the default movement mechanisms. Note, however, thatWalkSpeedis a client‑replicated property which can be modified locally, so it should not be used as a security mechanism or as the sole method for preventing humanoid movement. - The default animation script scales a humanoid's movement animations based on how fast it is moving relative to the default speed of 16 studs/second.
- The speed at which the
Humanoidis currently walking can be obtained using theRunningevent.
- When controlled on a mobile device or a gamepad, a humanoid can walk
slower than its
WalkToPart
: BasePartA reference to a part whose position is trying to be reached by a humanoid.WalkToPartis a reference to aBasePartthat the humanoid is trying to reach, after having been prompted to do so via theMoveTo()method.When
WalkToPartis set and a humanoid is actively trying to reach the part, it will keep updating itsVector3goal to be the position of the part, plus theWalkToPointtranslated in object space relative to the rotation of the part. This can be described in Luau as:goal = humanoid.WalkToPart.CFrame:PointToObjectSpace(humanoid.WalkToPoint)Note that simply setting the value of
WalkToPartis not sufficient to make a humanoid start "following" a part. CallMoveTo()to initiate movement.WalkToPoint
: Vector3The position that a humanoid is trying to reach, after a call toHumanoid.MoveTois made.WalkToPointdescribes the 3D position in space that a humanoid is trying to reach, after having been prompted to do so via theMoveTo()method.If a humanoid's
WalkToPartis set, the goal is set by transformingWalkToPointrelative to the part's position and rotation. Otherwise, the humanoid will try to reach the 3D position specified byWalkToPointdirectly.Note that simply setting the value of
WalkToPointis not sufficient to make a humanoid start moving toward a point. CallMoveTo()to initiate movement.
Methods 22
AddAccessory
(accessory: Instance) → ()Attaches the specifiedAccessoryto the humanoid's parent.This method attaches the specified
Accessoryto the humanoid's parent.When this method is called, an
Accessoryis attached to the character by searching for anAttachmentin the humanoid's parent that shares the same name as anAttachmentin the accessory's HandlePart. If one is found, the Handle part will be connected to the parent of theAttachmentusing aWeld, and the weld will be configured so theAttachmentsoccupy the same space.If the required
Attachmentcan not be found, then theAccessorywill remain parented to the humanoid's parent but it will be unattached.Typically, accessory welds are created on the server, but they can be created on the client under certain circumstances. In these situations, client-sided calls to
AddAccessory()may not always produce the desired behavior and you can useBuildRigFromAttachments()to force the expected weld creation.ApplyDescriptionAsync
(humanoidDescription: HumanoidDescription, assetTypeVerification: AssetTypeVerification = Default) → ()YieldsMakes the character's look match that of the passed inHumanoidDescription. IfHumanoidDescription.UseAvatarSettingsis true, the Avatar Settings for the experience will also be applied to the character.This yielding method makes the character's look match that of the passed in
HumanoidDescription. A copy of the passedHumanoidDescriptionis cached as theHumanoidDescriptionfor theHumanoid.This method is optimized through making the assumption that only this method is used to change the appearance of the character, and no changes are made through other means between calls. If changes are made to the character between calls, then this method may not make the character reflect the passed in
HumanoidDescriptionaccurately. If you want to use this method in conjunction with other means of updating the character,Humanoid.ApplyDescriptionResetAsyncwill always ensure the character reflects the passed inHumanoidDescription.See Also
Humanoid.GetAppliedDescriptionwhich returns theHumanoidDescriptioncurrently applied to the humanoid.Players.GetHumanoidDescriptionFromUserIdAsyncwhich returns aHumanoidDescriptiondescribing the avatar for the passed in user.Players.GetHumanoidDescriptionFromOutfitIdAsyncwhich returns aHumanoidDescriptionwhose parameters are initialized to match that of the passed in server-side outfit asset.Player.LoadCharacterWithHumanoidDescriptionAsyncwhich spawns a player with the look from the passed inHumanoidDescription.
ApplyDescriptionResetAsync
(humanoidDescription: HumanoidDescription, assetTypeVerification: AssetTypeVerification = Default) → ()YieldsMakes the character's look match that of the passed inHumanoidDescription, even after external changes.This yielding method makes the character's look match that of the passed in
HumanoidDescription, even after external changes. A copy of the passedHumanoidDescriptionis cached as theHumanoidDescriptionfor theHumanoid.This method will always ensure the character reflects the passed in
HumanoidDescription, even if changes have been made to the character not using theHumanoidDescriptionsystem (for example not usingApplyDescriptionResetAsync()orApplyDescriptionAsync()). This is in contrast toApplyDescriptionAsync()which is optimized and may incorrectly apply aHumanoidDescriptionif the character has been changed by means other than through theHumanoidDescriptionsystem.BuildRigFromAttachments
() → ()Assembles a tree ofMotor6Djoints by attaching togetherAttachmentobjects in a humanoid's character.This method assembles a tree of
Motor6Djoints for theHumanoid.Motor6Djoints are required for the playback ofAnimations.Starting from the humanoid's
RootPart, this method collects allAttachmentsparented in the current part whose name ends with RigAttachment. It then searches for a matching attachment in the character that shares the same name as the attachment. Using those two attachments, aMotor6Djoint is generated based on the parts associated with the two attachments and theCFrameof the attachments.Humanoid.BuildRigFromAttachmentsalso scales the character and sets body colors.ChangeState
(state: HumanoidStateType = None) → ()Sets theHumanoidto enter the givenHumanoidStateType.This method causes the
Humanoidto enter the givenHumanoidStateType, describing the activity theHumanoidis currently doing.Please review the
HumanoidStateTypepage for more information on the particular states, as some have unintuitive names. For example,HumanoidStateType.Runningdescribes a state where the humanoid's legs are on the ground, including when stationary.Due to the default behavior of the
Humanoid, some states will automatically be changed when set. For example:- Setting the state to
HumanoidStateType.Swimmingwhen the humanoid is not in the water will cause it to be automatically set toHumanoidStateType.GettingUp. - As it is unused, setting the state to
HumanoidStateType.PlatformStandingwill cause the humanoid state to be automatically set toHumanoidStateType.Running.
Note that in order to set the
Humanoidstate using this method, you must do so from aLocalScriptand the client must have network ownership of thePlayer.Character. Alternatively, you can call this method from a server-sideScript, but the server must have network ownership of the player character.See also
Humanoid.SetStateEnabledto enable or disable a particular state, andHumanoid.GetStateto get the current humanoid state.- Setting the state to
EquipTool
(tool: Instance) → ()Makes theHumanoidequip the givenTool.This method makes the
Humanoidequip the givenTool.When this method is called, the
Humanoidwill first automatically unequip allToolsthat it currently has equipped.Although they will be equipped,
Toolsfor whichTool.RequiresHandleistruewill not function if they have no handle, regardless if this method is used to equip them or not.See also
Humanoid.UnequipTools.GetAccessories
() → ArrayReturns an array ofAccessoryobjects that the humanoid's parent is currently wearing.This method returns an array of
Accessoryobjects that the humanoid's parent is currently wearing. All suchAccessoryobjects will be included, regardless of whether they're attached or not.If the
Humanoidhas noAccessoryobjects, an empty array will be returned.See also
Humanoid.AddAccessoryto attach anAccessoryto a humanoid's parent.GetAppliedDescription
() → HumanoidDescriptionReturns a copy of the humanoid's cachedHumanoidDescriptionwhich describes its current look.This method returns a copy of the humanoid's cached
HumanoidDescriptionwhich describes its current look. This can be used to quickly determine a character's look and to assign their look to other characters using theHumanoid.ApplyDescriptionAsyncmethod.See Also
Players.GetHumanoidDescriptionFromUserIdAsyncwhich returns aHumanoidDescriptiondescribing the avatar for the passed in user.Players.GetHumanoidDescriptionFromOutfitIdAsyncwhich returns aHumanoidDescriptionwhose parameters are initialized to match that of the passed in server-side outfit asset.Player.LoadCharacterWithHumanoidDescriptionAsyncwhich spawns a player with the look from the passed inHumanoidDescription.
GetBodyPartR15
(part: Instance) → BodyPartR15Pass a body part to this method (the body part should be a sibling of Humanoid, and a child of a Model) to get theBodyPartR15of thePart.This method returns what
BodyPartR15aPartis, orBodyPartR15.Unknownif the part is not an R15 body part. This method allows developers to retrieve player body parts independent of what the actual body part names are, instead returning an enum.It can be used in conjunction with
Humanoid.ReplaceBodyPartR15. For example, if a player's body part touches something, this function will return get a part instance. Developers can then look up what part of the body that was, like head or arm. Then depending on what that part was, developers can either perform some gameplay action or replace that part with some other part - perhaps showing damage.This method can be useful for games where hit location is important. For example, it can be used to determine if a player is hit in the leg and then slow them down based on the injury.
GetLimb
(part: Instance) → LimbReturns theLimbenum that is associated with the givenPart.This method returns the
Limbenum that is associated with the givenPart. It works for both R15 and R6 rigs, for example:-- For R15 print(humanoid:GetLimb(character.LeftUpperLeg)) -- Enum.Limb.LeftLeg print(humanoid:GetLimb(character.LeftLowerLeg)) -- Enum.Limb.LeftLeg print(humanoid:GetLimb(character.LeftFoot)) -- Enum.Limb.LeftLeg -- For R6 print(humanoid:GetLimb(character:FindFirstChild("Left Leg"))) -- Enum.Limb.LeftLegNote that
Humanoid.GetLimbwill throw an error if the part's parent is not set to the humanoid's parent.GetMoveVelocity
() → Vector3Returns the current intended movement velocity of the Humanoid.GetRelativeVelocityAtFloor
() → Vector3Returns the humanoid's actual physical velocity relative to the surface it is standing on as aVector3in world-space orientation.Returns the humanoid's actual physical velocity relative to the surface it is standing on as a
Vector3in world-space orientation. This accounts for moving platforms by subtracting floor velocity from the humanoid's body velocity. UnlikeHumanoid.GetMoveVelocity, which returns the intended input-driven velocity, this reflects the humanoid's true physics-based motion — useful for animation speed scaling or detecting whether a character is actually moving versus pushing against a wall. When the humanoid is airborne, the floor velocity component uses the last cached value from when it was grounded.GetState
() → HumanoidStateTypeReturns the humanoid's currentHumanoidStateType.This method returns the humanoid's current
HumanoidStateType, describing the activity theHumanoidis currently doing, such as jumping or swimming.See also
Humanoid.SetStateEnabledto enable or disable a particular state, andHumanoid.ChangeStateto change the current humanoid state.GetStateEnabled
(state: HumanoidStateType) → booleanReturns whether aHumanoidStateTypeis enabled for theHumanoid.The GetStateEnabled method returns whether a
HumanoidStateTypeis enabled for theHumanoid.The humanoid state describes the activity the humanoid is currently doing.
When a particular
HumanoidStateTypeis disabled, the humanoid can never enter that state. This is true regardless if the attempt to change state is made usingHumanoid.ChangeStateor Roblox internal humanoid code.See also:
- For an event that fires when a humanoid state is enabled or disabled see
Humanoid.StateEnabledChanged - To enable or disable a
Humanoidstate useHumanoid.SetStateEnabled
- For an event that fires when a humanoid state is enabled or disabled see
Move
(moveDirection: Vector3, relativeToCamera: boolean = false) → ()Causes theHumanoidto walk in the given direction.This method causes the
Humanoidto walk in the givenVector3direction.By default, the direction is in world terms, but if the
relativeToCameraparameter istrue, the direction is relative to theCFrameof theCurrentCamera. As the negative Z direction is considered "forwards" in Roblox, the following code will make the humanoid walk in the direction of theCurrentCamera.humanoid:Move(Vector3.new(0, 0, -1), true)When this method is called, the
Humanoidwill move until the method is called again. However, this method will be overwritten in the next frame by Roblox's default character control script. This can be avoided by either calling this function every frame usingRunService.BindToRenderStep(see example), or overwriting the control scripts inStarterPlayerScripts.This method can be called on the server, but this should only be done when the server has network ownership of the humanoid's assembly.
See also
Humanoid.MoveTowhich makes aHumanoidwalk to a point, andPlayer.Movewhich effectively calls this function.MoveTo
(location: Vector3, part: Instance = nil) → ()Causes theHumanoidto attempt to walk to the given location by setting theHumanoid.WalkToPointandHumanoid.WalkToPartproperties.This method causes the
Humanoidto attempt to walk to a given location by setting theWalkToPointandWalkToPartproperties, corresponding to thelocationandpartparameters.If the
partparameter is specified, theHumanoidwill still attempt to walk to thelocationparameter's point. However, if thepartmoves, the point will move to be at the same position relative to the part.Note that the movement operation will time out after 8 seconds if the humanoid doesn't reach its goal (this timeout exists so that humanoids do not get stuck waiting for
MoveToFinishedto fire). If you don't want this to happen, callMoveTo()at a repeated interval so that the timeout keeps resetting.MoveTo()ends if any of the following conditions apply:The character arrives at its destination, assuming a ~1 stud threshold to account for various humanoid speeds and framerates.
The character gets stuck and the timer expires.
The value of either
WalkToPointorWalkToPartchanges.A script calls
Move()with a newmoveDirectionparameter.A script changes the
CFrameproperty of the humanoid'sRootPart.
PlayEmoteAsync
(emoteName: string) → booleanYieldsPlays emotes and returns if was successfully ran.If the emote could not be played because the emoteName is not found in the HumanoidDescription, this method will give an error. The method will return true to indicate that the emote was played successfully.
RemoveAccessories
() → ()Removes allAccessoryobjects worn by the humanoid's parent.This method removes all
Accessoryobjects worn by the humanoid's parent. For playerCharacters, this will remove all hats and other accessories.This method removes
Accessoryobject by callingInstance.Destroyon them, meaning theParentof the accessories are set toniland locked.See also
Humanoid.AddAccessoryto attach anAccessory, andHumanoid.GetAccessoriesto get allAccessoryobjects belonging to aHumanoid.ReplaceBodyPartR15
(bodyPart: BodyPartR15, part: BasePart) → booleanDynamically replaces a Humanoid body part with a different part.Dynamically replaces a R15/Rthro limb part in a Humanoid with a different part. The part is automatically scaled as normal.
This method is useful for modifying characters during gameplay or building characters from a base rig. The related method
GetBodyPartR15can come in handy when using this method.The name of the part passed in should match with the name of the BodyPartR15 Enum passed in.
SetStateEnabled
(state: HumanoidStateType, enabled: boolean) → ()Sets whether a givenHumanoidStateTypeis enabled for theHumanoid.This method sets whether a given
HumanoidStateTypeis enabled for theHumanoid. When a particularHumanoidStateTypeis disabled, theHumanoidcan never enter that state. This is true regardless if the attempt to change state is made usingHumanoid.ChangeStateor Roblox internalHumanoidcode.Note that using
SetStateEnabled()on the server does not replicate the change to the client, nor vice-versa.TakeDamage
(amount: float) → ()Lowers theHumanoid.Healthof theHumanoidby the given amount if it is not protected by aForceField.This method lowers the
Humanoid.Healthof theHumanoidby the given amount if it is not protected by aForceFieldThis method accepts negative values for the amount parameter. This will increase the humanoid's
Humanoid.Health. However this will only have an effect if noForceFieldis present.How do ForceFields protect against TakeDamage
A
Humanoidis considered protected by aForceFieldif aForceFieldmeets one of the following criteria:- The
ForceFieldshares the sameInstance.Parentas theHumanoid - The
ForceFieldis parented to theHumanoid.RootPartof theHumanoid - The
ForceFieldis parented to an ancestor of theHumanoidother than theWorkspace
To do damage to a
Humanoidirrespective of anyForceFieldspresent, setHumanoid.Healthdirectly.For more information on how
ForceFieldsprotectHumanoidssee theForceFieldpage.- The
UnequipTools
() → ()Unequips anyToolcurrently equipped by theHumanoid.This method unequips any
Toolcurrently equipped by theHumanoid. The unequippedToolwill be parented to theBackpackof thePlayerassociated with theHumanoid.If no
Toolis equipped, this method will do nothing.Although
Toolscan be equipped by NPCs, this method only works onHumanoidswith a correspondingPlayer, as aBackpackobject is required to parent the unequippedToolto.See also
Humanoid.EquipTool.
Events 18
ApplyDescriptionFinished
Humanoid.ApplyDescriptionFinished:Connect(function(description))Fires when aHumanoidDescriptionhas finished being applied to theHumanoid.Fires when the
Humanoidfinishes applying aHumanoidDescriptionto the character, at the end ofHumanoid.ApplyDescriptionAsyncorHumanoid.ApplyDescriptionResetAsync. Thedescriptionparameter is theHumanoidDescriptionthat was applied.The event fires on the server and replicates to clients, so server or client listeners can respond when the character's appearance has been updated.
Climbing
Humanoid.Climbing:Connect(function(speed))Fires when the speed at which aHumanoidis climbing changes.Fires when the speed at which a
Humanoidis climbing changes.Humanoidscan climb up ladders made out ofPartsorTrussParts.Humanoidsclimb at 70% of theirHumanoid.WalkSpeed.This event will not always fire with a speed of 0 when the
Humanoidstops climbing.See also:
- For swimming and running see the
Humanoid.SwimmingandHumanoid.Runningevents - You can also detect when a
Humanoidis climbing using theHumanoid.StateChangedevent - You can disable climbing using the
Humanoid.SetStateEnabledfunction
- For swimming and running see the
Died
Humanoid.Died:Connect(function())Fires when theHumanoiddies.This event fires when the
Humanoiddies, usually whenHumanoid.Healthreaches 0. This could be caused either by disconnecting their head from theirHumanoid.Torso, or directly setting the health property.This event only fires if the
Humanoidis a descendant of theWorkspace. If theDeadHumanoidStateTypeis disabled it will not fire.FallingDown
Humanoid.FallingDown:Connect(function(active))Fires when theHumanoidenters or leaves theFallingDownHumanoidStateType.The FallingDown event fires when the
Humanoidenters and leaves theFallingDownHumanoidStateType.The
Humanoidwill enter theGettingUpstate 3 seconds after theFallingDownstate is enabled. When this happens this event will fire with an active value of false, andHumanoid.GettingUpwill fire with an active value of true.FreeFalling
Humanoid.FreeFalling:Connect(function(active))Fires when theHumanoidenters or leaves theFreefallHumanoidStateType.This event fires when the
Humanoidenters or leaves theFreefallHumanoidStateType.The active parameter represents whether the
Humanoidis entering or leaving theFreefallstate.Although the
Freefallstate generally ends when theHumanoidreaches the ground, this event may fire with active equal to false if the state is changed while theHumanoidis falling. For this reason, you should useHumanoid.StateChangedand listen for theLandedstate to work out when aHumanoidhas landed.GettingUp
Humanoid.GettingUp:Connect(function(active))Fires when theHumanoidenters or leaves theGettingUpHumanoidStateType.This event fires when the
Humanoidenters or leaves theHumanoidStateType.GettingUpstate, a transition state that is activated shortly after theHumanoidenters theFallingDown(3 seconds) orRagdoll(1 second) states.When a
Humanoidattempts to get back up, this event will first fire with anactiveparameter oftruebefore shortly after firing again with anactiveparameter offalse.To force a
Humanoidto fall over, use theHumanoid.ChangeStatefunction withHumanoidStateType.FallingDown.HealthChanged
Humanoid.HealthChanged:Connect(function(health))Fires when theHumanoid.Healthchanges (or when theHumanoid.MaxHealthis set).This event fires when the
Humanoid.Healthchanges. However, it will not fire if the health is increasing from a value equal to or greater than theHumanoid.MaxHealth.When
Humanoid.Healthreaches zero, theHumanoidwill die and theHumanoid.Diedevent will fire. This event will fire with a value of zero.Jumping
Humanoid.Jumping:Connect(function(active))Fires when theHumanoidenters and leaves theJumpingHumanoidStateType.This event fires when the
Humanoidenters and leaves theJumpingHumanoidStateType.When a
Humanoidjumps, this event fires with anactiveparameter oftruebefore shortly afterwards firing again with anactiveparameter offalse. This second firing does not correspond with aHumanoidlanding; for that, listen for theLandedHumanoidStateTypeusingHumanoid.StateChanged.You can disable jumping using the
Humanoid.SetStateEnabledfunction.MoveToFinished
Humanoid.MoveToFinished:Connect(function(reached))Fires when theHumanoidfinishes walking to a goal declared byHumanoid.MoveTo.This event fires when the
Humanoidfinishes walking to a goal declared by theHumanoid.WalkToPointandHumanoid.WalkToPartproperties.The
Humanoid.WalkToPointandHumanoid.WalkToPartproperties can be set individually, or using theHumanoid.MoveTofunction.If the
Humanoidreaches its goal within 8 seconds, this event will return with reached as true. If the goal is not reached within 8 seconds theHumanoidwill stop walking and reached will be false. This timeout can be reset be callingHumanoid.MoveToagain within the timeout period.PlatformStanding
Humanoid.PlatformStanding:Connect(function(active))Fires when theHumanoidenters or leaves thePlatformStandingHumanoidStateType.This event fires when the
Humanoidenters or leaves thePlatformStandingHumanoidStateType.Whilst the
Humanoidis in thePlatformStandingstate, theHumanoid.PlatformStandproperty will be true.Whilst
Humanoid.PlatformStandis set to true, theHumanoidwill be unable to move. For more information please see the page forHumanoid.PlatformStand.The PlatformStand
HumanoidStateTypewas associated with the now disabledPlatformpart. Despite this, it can still be used by developers.Ragdoll
Humanoid.Ragdoll:Connect(function(active))Fires when theHumanoidenters or leaves theRagdollHumanoidStateType.This event fires when the
Humanoidenters or leaves theRagdollHumanoidStateType.The
activeparameter will have the valuetrueorfalseto indicate entering or leaving.Use
Humanoid.SetStateEnabledto disable the GettingUp state to stay in the Ragdoll state.See also:
Humanoid.FallingDownfor theHumanoidevent connected with theFallingDownstate, which behaves similarly toRagdoll
Running
Humanoid.Running:Connect(function(speed))Fires when the speed at which aHumanoidis running changes.This event fires when the speed at which a
Humanoidis running changes.While running
Humanoidscover, on average, theirHumanoid.WalkSpeedin studs per second.When the
Humanoidstops running this event will fire with a speed of 0.See also:
- For swimming and climbing see the
Humanoid.SwimmingandHumanoid.Climbingevents - You can also detect when a
Humanoidis running using theHumanoid.StateChangedevent
- For swimming and climbing see the
Seated
Humanoid.Seated:Connect(function(active, currentSeatPart))Fired when aHumanoideither sits in aSeatorVehicleSeator gets up.This event fires when a
Humanoideither sits in or gets up from aSeatorVehicleSeat.When a character comes into contact with a seat, they are attached to the seat and a sitting animation plays. For more information on this, see the
Seatpage.- If the character is sitting down, the
activeparameter will be true andcurrentSeatPartwill be the seat they are currently sitting in. - If the character got up from a seat, the
activeparameter will be false andcurrentSeatPartwill benil.
See also:
Humanoid.Sit, which indicates if a Humanoid is currently sittingHumanoid.SeatPart, which indicates the seat a Humanoid is currently sitting in, if any.
- If the character is sitting down, the
StateChanged
Humanoid.StateChanged:Connect(function(old, new))Fires when the state of theHumanoidis changed.This event fires when the state of the
Humanoidis changed.As there is no "idle" humanoid state, you should instead use the
Humanoid.Runningevent or listen to theRootPartpart'sVelocityto work out when theHumanoidis standing still.See Also
Humanoid.GetStateandHumanoid.ChangeStateto get and set the state.Humanoid.SetStateEnabledto enable and disable specific states.
StateEnabledChanged
Humanoid.StateEnabledChanged:Connect(function(state, isEnabled))Fires whenHumanoid.SetStateEnabledis called on theHumanoid.The StateEnableChanged event fires when
Humanoid.SetStateEnabledis called on theHumanoid.Parameters include the
HumanoidStateTypein question along with a bool indicating if this state is now enabled.See also:
- To find if a state is currently enabled, use
Humanoid.GetStateEnabled - To listen to
Humanoidstate changes useHumanoid.StateChanged
- To find if a state is currently enabled, use
Strafing
Humanoid.Strafing:Connect(function(active))Fires when theHumanoidenters or leaves theStrafingNoPhysicsHumanoidStateType.This event does not fire when the
Humanoidis strafing and should not be used by developersThis event is fired when the
Humanoidenters or leaves theStrafingNoPhysicsHumanoidStateType.When the
Humanoidenters theStrafingNoPhysicsstate this event will fire with an active parameter of true. The event will fire again with active equal to false when theHumanoidleaves theStrafingNoPhysicsstate.This event is associated with the
StrafingNoPhysicsHumanoidstate and does not fire when theHumanoidis moving perpendicular to the direction it is facing. This state is currently unused, if it is set usingHumanoid.ChangeStatethe state will revert toRunningNoPhysics.Swimming
Humanoid.Swimming:Connect(function(speed))Fires when the speed at which aHumanoidis swimming inTerrainwater changes.This event fires when the speed at which a
Humanoidis swimming inTerrainwater changes.Humanoidsswim at 87.5% of theirHumanoid.WalkSpeed.This event will not always fire with a speed of 0 when the
Humanoidstops swimming.See also:
- For running and climbing see the
Humanoid.RunningandHumanoid.Climbingevents - You can also detect when a
Humanoidis swimming using theHumanoid.StateChangedevent - You can disable swimming using the
Humanoid.SetStateEnabledfunction
- For running and climbing see the
Touched
Humanoid.Touched:Connect(function(touchingPart, humanoidPart))Fires when one of the humanoid's limbs come in contact with anotherBasePart.This event fires when one of the humanoid's limbs comes in contact with another
BasePart. TheBasePartwhich the limb is touching, along with the limb itself, is given.This event will not fire when limbs belonging to the
Humanoidcome into contact with themselves.Alternatives
Although the
Humanoid.Touchedevent is useful, you should consider if there are alternatives that better suit your needs.- In most cases, it's advised to connect a
BasePart.Touchedevent forBasePartsof interest instead, as theHumanoid.Touchedevent will constantly fire when the humanoid is moving. For example, in a dodgeball game, it would be more practical to connect aTouchedevent for the balls rather than useHumanoid.Touched. - When trying to work out when the
Humanoidhas landed on the ground, theHumanoid.StateChangedevent is more suitable. Alternatively, you can checkHumanoid.FloorMaterialto see if the humanoid is standing on any non-air material.
Notes
- Connecting to this event will cause a
TouchTransmitterto be created in every limb. - There is currently no equivalent of
BasePart.TouchEndedforHumanoids.
- In most cases, it's advised to connect a
Humanoid also has every member of Instance. Deprecated and Roblox-only members are hidden.
Reference text from the Roblox Creator Documentation, licensed CC BY 4.0, reorganized by rbxtoolshub.com · Studio 0.743.0.7431133.