mirror of
https://github.com/rojo-rbx/rojo.git
synced 2026-10-23 14:01:37 +00:00
3066 lines
104 KiB
YAML
3066 lines
104 KiB
YAML
# This file is automatically generated. Please don't edit it manually.
|
||
# To submit a bug report on the content, see
|
||
# https://devforum.roblox.com/c/bug-reports/documentation-issues/72
|
||
|
||
name: Humanoid
|
||
type: class
|
||
memory_category: Instances
|
||
summary: |
|
||
A special object that gives models the functionality of a character.
|
||
description: |
|
||
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 `Class.Model`, and the model is expected to be an
|
||
assembly of `Class.BasePart` and `Class.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 `Class.CharacterMesh` objects.
|
||
- Certain properties, such as `Class.Humanoid.LeftLeg` and
|
||
`Class.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 `Class.NumberValue` objects
|
||
parented inside of the Humanoid.
|
||
- The Humanoid will automatically create `Class.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
|
||
code_samples:
|
||
- Walking-Camera-Bobble-Effect
|
||
inherits:
|
||
- Instance
|
||
descendants: []
|
||
tags: []
|
||
deprecation_message: ''
|
||
properties:
|
||
- name: Humanoid.AutoJumpEnabled
|
||
summary: |
|
||
Sets whether the character will automatically jump when they hit an
|
||
obstacle as a player on a mobile device.
|
||
description: |
|
||
AutoJumpEnabled sets whether or not the `Class.Humanoid` will 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 `Class.Player.Character` of a
|
||
`Class.Player`.
|
||
- The Player in question is using touch controls.
|
||
|
||
When a player's character spawns, the property's value matches the
|
||
player's `Class.Player.AutoJumpEnabled` property - which in turn matches
|
||
the `Class.StarterPlayer.AutoJumpEnabled` property.
|
||
code_samples:
|
||
- Auto-Jump-Toggle
|
||
type: boolean
|
||
tags: []
|
||
deprecation_message: ''
|
||
security:
|
||
read: None
|
||
write: None
|
||
thread_safety: ReadSafe
|
||
category: Jump Settings
|
||
serialization:
|
||
can_load: true
|
||
can_save: true
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid.AutomaticScalingEnabled
|
||
summary: |
|
||
When Enabled, AutomaticScalingEnabled causes the size of the character to
|
||
change in response to the values in the humanoid's child scale values
|
||
changing.
|
||
description: |
|
||
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 if
|
||
`AutomaticScalingEnabled` is true.
|
||
code_samples: []
|
||
type: boolean
|
||
tags: []
|
||
deprecation_message: ''
|
||
security:
|
||
read: None
|
||
write: None
|
||
thread_safety: ReadSafe
|
||
category: Game
|
||
serialization:
|
||
can_load: true
|
||
can_save: true
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid.AutoRotate
|
||
summary: |
|
||
AutoRotate sets whether or not the Humanoid will automatically rotate to
|
||
face in the direction they are moving in.
|
||
description: |
|
||
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:
|
||
|
||
<table>
|
||
<thead>
|
||
<tr>
|
||
<th>RotationType</th>
|
||
<th>Behavior</th>
|
||
<th>Context</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>MovementRelative</td>
|
||
<td></td>
|
||
<td></td>
|
||
</tr>
|
||
<tr>
|
||
<td>CameraRelative</td>
|
||
<td>Character will rotate to face in the direction of the camera.</td>
|
||
<td>Player has their camera zoomed into first-person, or they are in shift-lock mode.</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
code_samples:
|
||
- AutoRotate
|
||
type: boolean
|
||
tags: []
|
||
deprecation_message: ''
|
||
security:
|
||
read: None
|
||
write: None
|
||
thread_safety: ReadSafe
|
||
category: Control
|
||
serialization:
|
||
can_load: true
|
||
can_save: true
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid.BreakJointsOnDeath
|
||
summary: |
|
||
Determines whether the humanoid's joints break when in the
|
||
`Enum.HumanoidStateType.Dead` state.
|
||
description: |
|
||
Determines whether the humanoid's joints break when in the
|
||
`Enum.HumanoidStateType.Dead` state. Defaults to true.
|
||
code_samples: []
|
||
type: boolean
|
||
tags: []
|
||
deprecation_message: ''
|
||
security:
|
||
read: None
|
||
write: None
|
||
thread_safety: ReadSafe
|
||
category: Behavior
|
||
serialization:
|
||
can_load: true
|
||
can_save: true
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid.CameraOffset
|
||
summary: |
|
||
An offset applied to the Camera's subject position when its CameraSubject
|
||
is set to this Humanoid.
|
||
description: |
|
||
The CameraOffset property specifies an offset to the camera's subject
|
||
position when its `Class.Camera.CameraSubject` is set to this
|
||
`Class.Humanoid`.
|
||
|
||
The offset is applied in object-space, relative to the orientation of the
|
||
Humanoid's _HumanoidRootPart_. For example, an offset `Datatype.Vector3`
|
||
value of _(0, 10, 0)_ offsets the player's camera to 10 studs above the
|
||
player's humanoid.
|
||
code_samples:
|
||
- Walking-Camera-Bobble-Effect
|
||
type: Vector3
|
||
tags: []
|
||
deprecation_message: ''
|
||
security:
|
||
read: None
|
||
write: None
|
||
thread_safety: ReadSafe
|
||
category: Data
|
||
serialization:
|
||
can_load: false
|
||
can_save: false
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid.CollisionType
|
||
summary: |
|
||
Selects the `Enum.HumanoidCollisionType` for R15 and Rthro non-player
|
||
characters.
|
||
description: |
|
||
This property selects the `Enum.HumanoidCollisionType` for R15 and Rthro
|
||
non-player characters.
|
||
code_samples: []
|
||
type: HumanoidCollisionType
|
||
tags:
|
||
- Deprecated
|
||
deprecation_message: ''
|
||
security:
|
||
read: None
|
||
write: PluginSecurity
|
||
thread_safety: ReadSafe
|
||
category: Behavior
|
||
serialization:
|
||
can_load: true
|
||
can_save: true
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid.DisplayDistanceType
|
||
summary: |
|
||
Controls the distance behavior of the humanoid's name and health display.
|
||
description: |
|
||
The **DisplayDistanceType** property controls the distance behavior of the
|
||
humanoid's name and health display. This property is set using the
|
||
`Enum.HumanoidDisplayDistanceType` enum with three available values, each
|
||
with their own set of rules:
|
||
|
||
- When set to `Enum.HumanoidDisplayDistanceType|Viewer`, the humanoid sees
|
||
the name/health of other humanoids within range of its own
|
||
`NameDisplayDistance` and `HealthDisplayDistance`.
|
||
- When set to `Enum.HumanoidDisplayDistanceType|Subject`, the humanoid
|
||
takes **full control** over its own name and health display through its
|
||
`NameDisplayDistance` and `HealthDisplayDistance` values.
|
||
- When set to `Enum.HumanoidDisplayDistanceType|None`, the humanoid's name
|
||
and health bar do not appear under any circumstances.
|
||
|
||
See
|
||
[Character Name/Health Display](../../../characters/name-health-display.md)
|
||
for an in-depth guide on controlling the appearance of character names and
|
||
health bars.
|
||
code_samples:
|
||
- displaying-a-humanoid-s-health-and-name
|
||
type: HumanoidDisplayDistanceType
|
||
tags: []
|
||
deprecation_message: ''
|
||
security:
|
||
read: None
|
||
write: None
|
||
thread_safety: ReadSafe
|
||
category: Data
|
||
serialization:
|
||
can_load: true
|
||
can_save: true
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid.DisplayName
|
||
summary: |
|
||
Sets the text of a Humanoid, displayed above their head.
|
||
description: |
|
||
`DisplayName` is a property that determines the Humanoid's name display
|
||
when visible. By default, a new Humanoid will have the value of an empty
|
||
string. If `DisplayName` is 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 `Class.Player:LoadCharacterAsync()|LoadCharacterAsync()`, the Humanoid
|
||
that is created by the engine will have its `DisplayName` property set to
|
||
the player's `DisplayName` property.
|
||
|
||
#### StarterCharacter and StarterHumanoid
|
||
|
||
When a `Class.Humanoid` named `StarterHumanoid` is parented to
|
||
`Class.StarterPlayer`, or when a Humanoid is present in a Model named
|
||
`StarterCharacter`, the DisplayName property will be respected when
|
||
Characters are loaded by Players in the game. The engine will only
|
||
override the `DisplayName` property of the Humanoid with the `DisplayName`
|
||
property of the player if the `Class.Humanoid.DisplayName` of
|
||
`StarterHumanoid` is an empty string.
|
||
code_samples: []
|
||
type: string
|
||
tags: []
|
||
deprecation_message: ''
|
||
security:
|
||
read: None
|
||
write: None
|
||
thread_safety: ReadSafe
|
||
category: Data
|
||
serialization:
|
||
can_load: true
|
||
can_save: true
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid.EvaluateStateMachine
|
||
summary: |
|
||
Used to disable the internal physics and state machine of the Humanoid.
|
||
description: |
|
||
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 `Class.Part.CanCollide` enabled.
|
||
- **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
|
||
`Class.Humanoid.StateChanged|StateChanged` will still fire, which means
|
||
the Animate script will still receive them and animate the character
|
||
based on its current humanoid state.
|
||
- **Appearance** - `Class.HumanoidDescription`, clothes, accessories and
|
||
other humanoid rendering behavior.
|
||
- **Camera and player scripts** - The humanoid is still linked to
|
||
`Class.Players` and camera scripts, which ensures the camera will
|
||
continue to follow the `Class.Humanoid.RootPart`.
|
||
- **Player input handling** - The `Class.Humanoid.MoveDirection` property
|
||
will still be updated via the `Class.Humanoid:Move()` function and
|
||
`Class.PlayerScripts` for input.
|
||
code_samples: []
|
||
type: boolean
|
||
tags: []
|
||
deprecation_message: ''
|
||
security:
|
||
read: None
|
||
write: None
|
||
thread_safety: ReadSafe
|
||
category: Behavior
|
||
serialization:
|
||
can_load: true
|
||
can_save: true
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid.FloorMaterial
|
||
summary: |
|
||
Describes the `Enum.Material` that the `Class.Humanoid` is currently
|
||
standing on. If the `Class.Humanoid` isn't standing on anything, the value
|
||
of this property will be _Air_.
|
||
description: |
|
||
This is a read-only property that describes the `Enum.Material` the
|
||
`Class.Humanoid` is currently standing on. It works with both regular
|
||
`Class.BasePart|Parts` and `Class.Terrain` voxels.
|
||
|
||
The code sample below demonstrates how to listen to when this property
|
||
changes using `Class.Object:GetPropertyChangedSignal()`. When the material
|
||
the humanoid is standing on changes, it will print a message indicating
|
||
the new material being stood on.
|
||
|
||
```lua
|
||
local Humanoid = route.to.humanoid
|
||
|
||
Humanoid:GetPropertyChangedSignal("FloorMaterial"):Connect(function()
|
||
print("New value for FloorMaterial: " .. tostring(Humanoid.FloorMaterial))
|
||
end)
|
||
```
|
||
|
||
#### Caveats
|
||
|
||
- When the `Class.Humanoid` is 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 `Class.Humanoid` must be able to collide with
|
||
the floor, or else it will not be detected.
|
||
- You cannot test if the `Class.Humanoid` is swimming with this
|
||
property. You should instead use its `Class.Humanoid:GetState()`
|
||
function.
|
||
code_samples: []
|
||
type: Material
|
||
tags:
|
||
- ReadOnly
|
||
- NotReplicated
|
||
deprecation_message: ''
|
||
security:
|
||
read: None
|
||
write: None
|
||
thread_safety: ReadSafe
|
||
category: Control
|
||
serialization:
|
||
can_load: false
|
||
can_save: false
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid.Health
|
||
summary: |
|
||
Describes the current health of the Humanoid on the range [0,
|
||
`Class.Humanoid.MaxHealth`].
|
||
description: |
|
||
This property represents the current health of the `Class.Humanoid`. The
|
||
value is restricted to the range between 0 and
|
||
`Class.Humanoid.MaxHealth|MaxHealth`. If the humanoid is dead, this
|
||
property is continually set to 0.
|
||
|
||
Note that the `Class.Humanoid:TakeDamage()|TakeDamage()` function may be
|
||
used to subtract from `Class.Humanoid.Health|Health` instead 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
|
||
`Class.Humanoid.MaxHealth|MaxHealth` each second. To disable this
|
||
regeneration behavior, add an empty `Class.Script` named **Health** to
|
||
`Class.StarterCharacterScripts`.
|
||
|
||
#### Health Bar Display
|
||
|
||
When `Class.Humanoid.Health|Health` is less than
|
||
`Class.Humanoid.MaxHealth|MaxHealth`, a health bar is displayed
|
||
in-experience. The display behavior of the health bar is dependent on the
|
||
`Class.Humanoid.HealthDisplayDistance|HealthDisplayDistance` and
|
||
`Class.Humanoid.HealthDisplayType|HealthDisplayType`.
|
||
|
||
See
|
||
[Character Name/Health Display](../../../characters/name-health-display.md)
|
||
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 `Class.Humanoid`
|
||
automatically transitions to the `Enum.HumanoidStateType.Dead` state. In
|
||
this state, `Class.Humanoid.Health|Health` is locked to 0; however, there
|
||
is no error or warning for setting the `Class.Humanoid.Health|Health` of a
|
||
dead humanoid to a positive nonzero value.
|
||
code_samples: []
|
||
type: float
|
||
tags:
|
||
- NotReplicated
|
||
deprecation_message: ''
|
||
security:
|
||
read: None
|
||
write: None
|
||
thread_safety: ReadSafe
|
||
category: Game
|
||
serialization:
|
||
can_load: true
|
||
can_save: false
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid.HealthDisplayDistance
|
||
summary: |
|
||
Used in conjunction with the
|
||
`Class.Humanoid.DisplayDistanceType|DisplayDistanceType` property to
|
||
control the distance from which a humanoid's health bar can be seen.
|
||
description: |
|
||
This property is a number used in conjunction with the
|
||
`Class.Humanoid.DisplayDistanceType|DisplayDistanceType` property to
|
||
control the distance from which a humanoid's health bar can be seen.
|
||
|
||
See
|
||
[Character Name/Health Display](../../../characters/name-health-display.md)
|
||
for an in-depth guide on controlling the appearance of character names and
|
||
health bars.
|
||
code_samples: []
|
||
type: float
|
||
tags: []
|
||
deprecation_message: ''
|
||
security:
|
||
read: None
|
||
write: None
|
||
thread_safety: ReadSafe
|
||
category: Data
|
||
serialization:
|
||
can_load: true
|
||
can_save: true
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid.HealthDisplayType
|
||
summary: |
|
||
Controls when the humanoid's health bar is allowed to be displayed.
|
||
description: |
|
||
This property controls when a humanoid's health bar is allowed to be
|
||
displayed. By default, this property is set to
|
||
`Enum.HumanoidHealthDisplayType|DisplayWhenDamaged`, which makes the
|
||
health bar only display when a humanoid's `Class.Humanoid.Health|Health`
|
||
is less than its `Class.Humanoid.MaxHealth|MaxHealth`. It can also be set
|
||
to `Enum.HumanoidHealthDisplayType|AlwaysOn`, which makes the health bar
|
||
always display, or `Enum.HumanoidHealthDisplayType|AlwaysOff`, which
|
||
prevents it from ever displaying.
|
||
|
||
Note that this property functions independently of the humanoid's
|
||
`Class.Humanoid.HealthDisplayDistance|HealthDisplayDistance` property
|
||
which is responsible for making the health bar fade out at certain
|
||
distances. If `Humanoid.HealthDisplayType|HealthDisplayType` is set to
|
||
`Enum.HumanoidHealthDisplayType|AlwaysOn`, it will still fade out
|
||
depending the how
|
||
`Class.Humanoid.HealthDisplayDistance|HealthDisplayDistance` is
|
||
configured.
|
||
|
||
See
|
||
[Character Name/Health Display](../../../characters/name-health-display.md)
|
||
for an in-depth guide on controlling the appearance of character names and
|
||
health bars.
|
||
code_samples: []
|
||
type: HumanoidHealthDisplayType
|
||
tags: []
|
||
deprecation_message: ''
|
||
security:
|
||
read: None
|
||
write: None
|
||
thread_safety: ReadSafe
|
||
category: Data
|
||
serialization:
|
||
can_load: true
|
||
can_save: true
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid.HipHeight
|
||
summary: |
|
||
Determines the distance off the ground the `Class.Humanoid.RootPart`
|
||
should be.
|
||
description: |
|
||
Determines the distance (in studs) off the ground the
|
||
`Class.Humanoid.RootPart|RootPart` should be when the humanoid is
|
||
standing. The `Class.Humanoid.RigType|RigType` influences the way this
|
||
property behaves.
|
||
|
||
For R15 rigs, a suitable hip height is preset to ensure the height of the
|
||
`Class.Humanoid.RootPart|RootPart` is correct. The height of the legs is
|
||
not used. The overall height of the humanoid can be described in the
|
||
following formula:
|
||
|
||
```lua
|
||
Height = (0.5 * RootPart.Size.Y) + HipHeight
|
||
```
|
||
|
||
For R6 rigs, `Class.Humanoid.HipHeight|HipHeight` instead describes a
|
||
relative offset. The overall height of the humanoid can be described in
|
||
the following formula:
|
||
|
||
```lua
|
||
Height = LeftLeg.Size.Y + (0.5 * RootPart.Size.Y) + HipHeight
|
||
```
|
||
code_samples: []
|
||
type: float
|
||
tags: []
|
||
deprecation_message: ''
|
||
security:
|
||
read: None
|
||
write: None
|
||
thread_safety: ReadSafe
|
||
category: Game
|
||
serialization:
|
||
can_load: true
|
||
can_save: true
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid.Jump
|
||
summary: |
|
||
If `true`, the `Class.Humanoid` jumps with an upwards force.
|
||
description: |
|
||
If `true`, the `Class.Humanoid` jumps with an upwards force equal to the
|
||
value of `Class.Humanoid.JumpPower` or the height of
|
||
`Class.Humanoid.JumpHeight`, depending on the value of
|
||
`Class.Humanoid.UseJumpPower`.
|
||
code_samples: []
|
||
type: boolean
|
||
tags:
|
||
- NotReplicated
|
||
deprecation_message: ''
|
||
security:
|
||
read: None
|
||
write: None
|
||
thread_safety: ReadSafe
|
||
category: Control
|
||
serialization:
|
||
can_load: true
|
||
can_save: false
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid.JumpHeight
|
||
summary: |
|
||
Provides control over the height that the `Class.Humanoid` jumps to.
|
||
description: |
|
||
Provides control over the height a `Class.Humanoid` jumps, in studs. The
|
||
starting value of this property is determined by the value of
|
||
`Class.StarterPlayer.CharacterJumpHeight` which 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
|
||
`Enum.HumanoidStateType.Jumping` state through
|
||
`Class.Humanoid:SetStateEnabled()`.
|
||
|
||
This property is only visible in the
|
||
[Properties](../../../studio/properties.md) window if
|
||
`Class.Humanoid.UseJumpPower` is set to **false**, as it is not relevant
|
||
otherwise (instead, `Class.Humanoid.JumpPower` is used).
|
||
code_samples: []
|
||
type: float
|
||
tags: []
|
||
deprecation_message: ''
|
||
security:
|
||
read: None
|
||
write: None
|
||
thread_safety: ReadSafe
|
||
category: Jump Settings
|
||
serialization:
|
||
can_load: true
|
||
can_save: true
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid.JumpPower
|
||
summary: |
|
||
Determines how much upwards force is applied to the `Class.Humanoid` when
|
||
jumping.
|
||
description: |
|
||
Determines how much upwards force is applied to the `Class.Humanoid` when
|
||
jumping. The starting value of this property is determined by the value of
|
||
`Class.StarterPlayer.CharacterJumpPower` which defaults to 50 and is
|
||
constrained between 0 and 1000. Note that jumps are also influenced by the
|
||
`Class.Workspace.Gravity` property 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
|
||
`Enum.HumanoidStateType.Jumping` state through
|
||
`Class.Humanoid:SetStateEnabled()`.
|
||
|
||
This property is only visible in the
|
||
[Properties](../../../studio/properties.md) window if
|
||
`Class.Humanoid.UseJumpPower` is set to **true**, as it is not relevant
|
||
otherwise (instead, `Class.Humanoid.JumpHeight` is used).
|
||
code_samples: []
|
||
type: float
|
||
tags: []
|
||
deprecation_message: ''
|
||
security:
|
||
read: None
|
||
write: None
|
||
thread_safety: ReadSafe
|
||
category: Jump Settings
|
||
serialization:
|
||
can_load: true
|
||
can_save: true
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid.LeftLeg
|
||
summary: |
|
||
A reference to the humanoid's _Left Leg_ part.
|
||
description: |
|
||
A reference to the humanoid's _Left Leg_ part. The value of this property
|
||
will always be `nil` if the humanoid's `Enum.RigType` is set to R15.
|
||
code_samples: []
|
||
type: BasePart
|
||
tags:
|
||
- Hidden
|
||
- NotReplicated
|
||
- Deprecated
|
||
deprecation_message: |
|
||
This instance only works with the old R6 rig. It will not work with the
|
||
R15 rig and should not be used in new work not using the R6 rig.
|
||
security:
|
||
read: None
|
||
write: None
|
||
thread_safety: ReadSafe
|
||
category: Data
|
||
serialization:
|
||
can_load: true
|
||
can_save: false
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid.MaxHealth
|
||
summary: |
|
||
The maximum value of a humanoid's `Class.Humanoid.Health|Health`.
|
||
description: |
|
||
The maximum value of a humanoid's `Class.Humanoid.Health|Health`.
|
||
|
||
The value of this property is used alongside the
|
||
`Class.Humanoid.Health|Health` property to size the default health bar
|
||
display. When a humanoid's `Class.Humanoid.Health|Health` reaches
|
||
`Class.Humanoid.MaxHealth|MaxHealth`, its health bar may not be displayed,
|
||
depending on its `Class.Humanoid.HealthDisplayType|HealthDisplayType`
|
||
property.
|
||
code_samples: []
|
||
type: float
|
||
tags: []
|
||
deprecation_message: ''
|
||
security:
|
||
read: None
|
||
write: None
|
||
thread_safety: ReadSafe
|
||
category: Game
|
||
serialization:
|
||
can_load: true
|
||
can_save: true
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid.maxHealth
|
||
summary: ''
|
||
description: ''
|
||
code_samples: []
|
||
type: float
|
||
tags:
|
||
- NotReplicated
|
||
- Deprecated
|
||
deprecation_message: |
|
||
This deprecated property is a variant of `Class.Humanoid.MaxHealth` which
|
||
should be used instead.
|
||
security:
|
||
read: None
|
||
write: None
|
||
thread_safety: ReadSafe
|
||
category: Game
|
||
serialization:
|
||
can_load: true
|
||
can_save: false
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid.MaxSlopeAngle
|
||
summary: |
|
||
The maximum slope angle that a humanoid can walk on without slipping.
|
||
description: |
|
||
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
|
||
`Class.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.
|
||
code_samples:
|
||
- limiting-the-slope-a-humanoid-can-walk-up
|
||
type: float
|
||
tags: []
|
||
deprecation_message: ''
|
||
security:
|
||
read: None
|
||
write: None
|
||
thread_safety: ReadSafe
|
||
category: Game
|
||
serialization:
|
||
can_load: true
|
||
can_save: true
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid.MoveDirection
|
||
summary: |
|
||
Describes the direction that the `Class.Humanoid` is walking in.
|
||
description: |
|
||
**MoveDirection** is a read-only property that describes the direction a
|
||
`Class.Humanoid` is 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 `Class.Script`
|
||
or `Class.LocalScript`.
|
||
code_samples:
|
||
- Walking-Camera-Bobble-Effect
|
||
type: Vector3
|
||
tags:
|
||
- ReadOnly
|
||
- NotReplicated
|
||
deprecation_message: ''
|
||
security:
|
||
read: None
|
||
write: None
|
||
thread_safety: ReadSafe
|
||
category: Control
|
||
serialization:
|
||
can_load: false
|
||
can_save: false
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid.NameDisplayDistance
|
||
summary: |
|
||
Used in conjunction with the `Class.Humanoid.DisplayDistanceType` property
|
||
to control the distance from which a humanoid's name can be seen.
|
||
description: |
|
||
The **NameDisplayDistance** property is a number used in conjunction with
|
||
the `Class.Humanoid.DisplayDistanceType` property to control the distance
|
||
from which a humanoid's name can be seen.
|
||
|
||
See
|
||
[Character Name/Health Display](../../../characters/name-health-display.md)
|
||
for an in-depth guide on controlling the appearance of character names and
|
||
health bars.
|
||
code_samples: []
|
||
type: float
|
||
tags: []
|
||
deprecation_message: ''
|
||
security:
|
||
read: None
|
||
write: None
|
||
thread_safety: ReadSafe
|
||
category: Data
|
||
serialization:
|
||
can_load: true
|
||
can_save: true
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid.NameOcclusion
|
||
summary: |
|
||
Controls whether a humanoid's name and health bar can be seen behind walls
|
||
or other objects.
|
||
description: |
|
||
Controls whether a humanoid's name and health bar can be seen behind walls
|
||
or other objects. This property is a `Enum.NameOcclusion` value and can be
|
||
configured to occlude all names, enemy names, or disable occlusion
|
||
entirely.
|
||
|
||
In cases where the `Class.Players.LocalPlayer|LocalPlayer` has no
|
||
`Class.Humanoid` associated with it, this property instead applies to the
|
||
subject `Class.Humanoid`.
|
||
|
||
See
|
||
[Character Name/Health Display](../../../characters/name-health-display.md)
|
||
for an in-depth guide on controlling the appearance of character names and
|
||
health bars.
|
||
code_samples:
|
||
- occlude-player-names
|
||
type: NameOcclusion
|
||
tags: []
|
||
deprecation_message: ''
|
||
security:
|
||
read: None
|
||
write: None
|
||
thread_safety: ReadSafe
|
||
category: Data
|
||
serialization:
|
||
can_load: true
|
||
can_save: true
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid.PlatformStand
|
||
summary: |
|
||
Determines whether the `Class.Humanoid` is currently in the
|
||
`Enum.HumanoidStateType.PlatformStanding` state.
|
||
description: |
|
||
Determines whether the `Class.Humanoid` is currently in the
|
||
`Enum.HumanoidStateType.PlatformStanding` state. 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.
|
||
code_samples: []
|
||
type: boolean
|
||
tags: []
|
||
deprecation_message: ''
|
||
security:
|
||
read: None
|
||
write: None
|
||
thread_safety: ReadSafe
|
||
category: Control
|
||
serialization:
|
||
can_load: false
|
||
can_save: false
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid.RequiresNeck
|
||
summary: |
|
||
Allows developers to disable the behavior where a player
|
||
`Character|character` dies if the Neck `Class.Motor6D` is removed or
|
||
disconnected even momentarily.
|
||
description: |
|
||
Allows developers to disable the behavior where a player
|
||
`Character|character` dies if the Neck `Class.Motor6D` is removed or
|
||
disconnected even momentarily. This property defaults to true.
|
||
code_samples: []
|
||
type: boolean
|
||
tags: []
|
||
deprecation_message: ''
|
||
security:
|
||
read: None
|
||
write: None
|
||
thread_safety: ReadSafe
|
||
category: Behavior
|
||
serialization:
|
||
can_load: true
|
||
can_save: true
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid.RightLeg
|
||
summary: |
|
||
A reference to the humanoid's _Right Leg_ part.
|
||
description: |
|
||
A reference to the humanoid's _Right Leg_ part. The value of this property
|
||
will always be `nil` if the humanoid's RigType is set to R15.
|
||
code_samples: []
|
||
type: BasePart
|
||
tags:
|
||
- Hidden
|
||
- NotReplicated
|
||
- Deprecated
|
||
deprecation_message: |
|
||
This instance only works with the old R6 rig. It will not work with the
|
||
R15 rig and should not be used in new work not using the R6 rig.
|
||
security:
|
||
read: None
|
||
write: None
|
||
thread_safety: ReadSafe
|
||
category: Data
|
||
serialization:
|
||
can_load: true
|
||
can_save: false
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid.RigType
|
||
summary: |
|
||
Describes whether this `Class.Humanoid` is utilizing the legacy R6
|
||
character rig, or the new R15 character rig.
|
||
description: |
|
||
**RigType** describes whether a `Class.Humanoid` is utilizing the legacy
|
||
R6 character rig, or the newer R15 character rig.
|
||
|
||
The R6 rig uses 6 visible `Class.Part|Parts` while the R15 rig uses 15
|
||
visible `Class.Part|Parts`. 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 `Class.Humanoid` will
|
||
not function correctly. For example, if a R15 humanoid's **RigType** is
|
||
set to R6, the `Class.Humanoid` will die as there is no `Class.BasePart`
|
||
called **Torso** connected to a `Class.BasePart` called **Head**.
|
||
code_samples: []
|
||
type: HumanoidRigType
|
||
tags: []
|
||
deprecation_message: ''
|
||
security:
|
||
read: None
|
||
write: None
|
||
thread_safety: ReadSafe
|
||
category: Data
|
||
serialization:
|
||
can_load: true
|
||
can_save: true
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid.RootPart
|
||
summary: |
|
||
A reference to the humanoid's **HumanoidRootPart** object.
|
||
description: |
|
||
A reference to the humanoid's **HumanoidRootPart** object, the root
|
||
driving part of the `Class.Humanoid` that controls a humanoid's movement
|
||
through the 3D world. This part is normally invisible.
|
||
|
||
For R15 characters, `Class.Model.PrimaryPart` of the
|
||
`Class.Player.Character` model is set to **HumanoidRootPart**.
|
||
|
||
For R6 characters, `Class.Model.PrimaryPart` is set to the `Head` part.
|
||
code_samples: []
|
||
type: BasePart
|
||
tags:
|
||
- ReadOnly
|
||
- NotReplicated
|
||
deprecation_message: ''
|
||
security:
|
||
read: None
|
||
write: None
|
||
thread_safety: ReadSafe
|
||
category: Data
|
||
serialization:
|
||
can_load: false
|
||
can_save: true
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid.SeatPart
|
||
summary: |
|
||
A reference to the seat that a `Class.Humanoid` is currently sitting in,
|
||
if any.
|
||
description: |
|
||
SeatPart is a reference to the seat that a `Class.Humanoid` is currently
|
||
sitting in, if any. The value of this property can be either a
|
||
`Class.Seat`, or a `Class.VehicleSeat`. It will be _nil_ if the Humanoid
|
||
is not currently sitting in a seat.
|
||
|
||
Note:
|
||
|
||
- For a bool describing if the `Class.Humanoid` is currently sitting or
|
||
not, see `Class.Humanoid.Sit`
|
||
code_samples: []
|
||
type: BasePart
|
||
tags:
|
||
- ReadOnly
|
||
- NotReplicated
|
||
deprecation_message: ''
|
||
security:
|
||
read: None
|
||
write: None
|
||
thread_safety: ReadSafe
|
||
category: Control
|
||
serialization:
|
||
can_load: false
|
||
can_save: false
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid.Sit
|
||
summary: |
|
||
Describes whether the `Class.Humanoid` is currently sitting.
|
||
description: |
|
||
The Sit property is a boolean that indicates whether the `Class.Humanoid`
|
||
is currently sitting. `Class.Humanoid|Humanoids` can be forced into a
|
||
sitting state by setting this property's value to true. If the
|
||
`Class.Humanoid` isn't attached to a seat while in its sitting state, it
|
||
will trip over with no collision in its legs. A `Class.Humanoid` can
|
||
escape from the sitting state by jumping.
|
||
|
||
Note:
|
||
|
||
- The `Class.Seat` or `Class.VehicleSeat` the `Class.Humanoid` is sitting
|
||
on can be obtained using the `Class.Humanoid.SeatPart` property
|
||
- It is possible to detect when a Humanoid sits by connecting to the
|
||
`Class.Humanoid.Seated` event.
|
||
code_samples: []
|
||
type: boolean
|
||
tags: []
|
||
deprecation_message: ''
|
||
security:
|
||
read: None
|
||
write: None
|
||
thread_safety: ReadSafe
|
||
category: Control
|
||
serialization:
|
||
can_load: false
|
||
can_save: false
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid.TargetPoint
|
||
summary: |
|
||
Describes the 3D position where the `Class.Player` controlling the
|
||
`Class.Humanoid` last clicked in the world while using a `Class.Tool`.
|
||
description: |
|
||
**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 `Class.Player`
|
||
controlling this `Class.Humanoid` last clicked with a `Class.Tool`
|
||
equipped.
|
||
|
||
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 `Class.Tool:Activate()` function, you can make the NPC fire a
|
||
rocket at the target point.
|
||
code_samples: []
|
||
type: Vector3
|
||
tags: []
|
||
deprecation_message: ''
|
||
security:
|
||
read: None
|
||
write: None
|
||
thread_safety: ReadSafe
|
||
category: Control
|
||
serialization:
|
||
can_load: false
|
||
can_save: false
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid.Torso
|
||
summary: |
|
||
A reference to a humanoid's root driving part.
|
||
description: |
|
||
A reference to a humanoid's root driving part. Contrary to the name of
|
||
this property, it will only point to the Torso part if a humanoid doesn't
|
||
have a HumanoidRootPart.
|
||
code_samples: []
|
||
type: BasePart
|
||
tags:
|
||
- Hidden
|
||
- NotReplicated
|
||
- Deprecated
|
||
deprecation_message: |
|
||
This instance only works with the old R6 rig. It will not work with the
|
||
R15 rig and should not be used in new work not using the R6 rig.
|
||
security:
|
||
read: None
|
||
write: None
|
||
thread_safety: ReadSafe
|
||
category: Data
|
||
serialization:
|
||
can_load: true
|
||
can_save: false
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid.UseJumpPower
|
||
summary: |
|
||
Determines whether the `Class.Humanoid.JumpHeight|JumpHeight` (false) or
|
||
`Class.Humanoid.JumpPower` (true) property is used.
|
||
description: |
|
||
When a character spawns, this property is set according to the value of
|
||
`Class.StarterPlayer.CharacterUseJumpPower`, which defaults to true.
|
||
|
||
When jumping, with this set to false, the `Class.Humanoid.JumpHeight`
|
||
value is used to ensure the humanoid jumps to that height. With this set
|
||
to true, the `Class.Humanoid.JumpPower` value is used to apply an upward
|
||
force.
|
||
code_samples: []
|
||
type: boolean
|
||
tags: []
|
||
deprecation_message: ''
|
||
security:
|
||
read: None
|
||
write: None
|
||
thread_safety: ReadSafe
|
||
category: Jump Settings
|
||
serialization:
|
||
can_load: true
|
||
can_save: true
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid.WalkSpeed
|
||
summary: |
|
||
Describes the humanoid's maximum movement speed in studs per second.
|
||
description: |
|
||
This property describes how quickly the `Class.Humanoid` is able to walk,
|
||
in studs per second. It defaults to the value of
|
||
`Class.StarterPlayer.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 `Class.Humanoid.WalkSpeed|WalkSpeed` if the controlling
|
||
thumbstick is moved just a gradual degree from center.
|
||
- You can freeze a humanoid in place by setting
|
||
`Class.Humanoid.WalkSpeed|WalkSpeed` to `0`, effectively preventing the
|
||
controlling player from moving it through the default movement
|
||
mechanisms. Note, however, that `Class.Humanoid.WalkSpeed|WalkSpeed` is
|
||
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 `Class.Humanoid` is currently walking can be
|
||
obtained using the `Class.Humanoid.Running|Running` event.
|
||
code_samples: []
|
||
type: float
|
||
tags: []
|
||
deprecation_message: ''
|
||
security:
|
||
read: None
|
||
write: None
|
||
thread_safety: ReadSafe
|
||
category: Game
|
||
serialization:
|
||
can_load: true
|
||
can_save: true
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid.WalkToPart
|
||
summary: |
|
||
A reference to a part whose position is trying to be reached by a
|
||
humanoid.
|
||
description: |
|
||
`WalkToPart` is a reference to a `Class.BasePart` that the humanoid is
|
||
trying to reach, after having been prompted to do so via the
|
||
`Class.Humanoid:MoveTo()|MoveTo()` method.
|
||
|
||
When `WalkToPart` is set and a humanoid is actively trying to reach the
|
||
part, it will keep updating its `Datatype.Vector3` goal to be the position
|
||
of the part, plus the `Class.Humanoid.WalkToPoint|WalkToPoint` translated
|
||
in object space relative to the rotation of the part. This can be
|
||
described in Luau as:
|
||
|
||
```lua
|
||
goal = humanoid.WalkToPart.CFrame:PointToObjectSpace(humanoid.WalkToPoint)
|
||
```
|
||
|
||
Note that simply setting the value of `WalkToPart` is not sufficient to
|
||
make a humanoid start "following" a part. Call
|
||
`Class.Humanoid:MoveTo()|MoveTo()` to initiate movement.
|
||
code_samples: []
|
||
type: BasePart
|
||
tags: []
|
||
deprecation_message: ''
|
||
security:
|
||
read: None
|
||
write: None
|
||
thread_safety: ReadSafe
|
||
category: Control
|
||
serialization:
|
||
can_load: false
|
||
can_save: false
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid.WalkToPoint
|
||
summary: |
|
||
The position that a humanoid is trying to reach, after a call to
|
||
`Class.Humanoid:MoveTo()` is made.
|
||
description: |
|
||
`WalkToPoint` describes the 3D position in space that a humanoid is trying
|
||
to reach, after having been prompted to do so via the
|
||
`Class.Humanoid:MoveTo()|MoveTo()` method.
|
||
|
||
If a humanoid's `Class.Humanoid.WalkToPart|WalkToPart` is set, the goal is
|
||
set by transforming `WalkToPoint` relative to the part's position and
|
||
rotation. Otherwise, the humanoid will try to reach the 3D position
|
||
specified by `WalkToPoint` directly.
|
||
|
||
Note that simply setting the value of `WalkToPoint` is not sufficient to
|
||
make a humanoid start moving toward a point. Call
|
||
`Class.Humanoid:MoveTo()|MoveTo()` to initiate movement.
|
||
code_samples: []
|
||
type: Vector3
|
||
tags: []
|
||
deprecation_message: ''
|
||
security:
|
||
read: None
|
||
write: None
|
||
thread_safety: ReadSafe
|
||
category: Control
|
||
serialization:
|
||
can_load: false
|
||
can_save: false
|
||
capabilities:
|
||
- Avatar
|
||
methods:
|
||
- name: Humanoid:AddAccessory
|
||
summary: |
|
||
Attaches the specified `Class.Accessory` to the humanoid's parent.
|
||
description: |
|
||
This method attaches the specified `Class.Accessory` to the humanoid's
|
||
parent.
|
||
|
||
When this method is called, an `Class.Accessory` is attached to the
|
||
character by searching for an `Class.Attachment` in the humanoid's parent
|
||
that shares the same name as an `Class.Attachment` in the accessory's
|
||
**Handle** `Class.Part`. If one is found, the **Handle** part will be
|
||
connected to the parent of the `Class.Attachment` using a `Class.Weld`,
|
||
and the weld will be configured so the `Class.Attachment|Attachments`
|
||
occupy the same space.
|
||
|
||
If the required `Class.Attachment` can not be found, then the
|
||
`Class.Accessory` will 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 `Class.Humanoid:AddAccessory()|AddAccessory()` may
|
||
not always produce the desired behavior and you can use
|
||
`Class.Humanoid:BuildRigFromAttachments()|BuildRigFromAttachments()` to
|
||
force the expected weld creation.
|
||
code_samples:
|
||
- Humanoid-AddAccessory-Example
|
||
parameters:
|
||
- name: accessory
|
||
type: Instance
|
||
default:
|
||
summary: |
|
||
The `Class.Accessory` to be attached.
|
||
returns:
|
||
- type: ()
|
||
summary: ''
|
||
tags: []
|
||
deprecation_message: ''
|
||
security: None
|
||
thread_safety: Unsafe
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid:AddCustomStatus
|
||
summary: |
|
||
Adds a custom status to the Humanoid.
|
||
description: |
|
||
Adds a BoolValue to the Humanoid's _Status_ object, whose name is equal to
|
||
the string passed as the _status_ argument. If the status already exists,
|
||
a new BoolValue will not be created.
|
||
code_samples: []
|
||
parameters:
|
||
- name: status
|
||
type: string
|
||
default:
|
||
summary: ''
|
||
returns:
|
||
- type: boolean
|
||
summary: ''
|
||
tags:
|
||
- Deprecated
|
||
deprecation_message: |
|
||
This item is deprecated, as it was a part of the unfinished RbxStatus
|
||
library which would have allowed you to add conditions to a Humanoid. Do
|
||
not use it for new work.
|
||
security: None
|
||
thread_safety: Unsafe
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid:AddStatus
|
||
summary: |
|
||
Adds a BoolValue to the Humanoid's _Status_ object.
|
||
description: |
|
||
Adds a BoolValue to the Humanoid's _Status_ object, whose name is equal to
|
||
the name of the _Status_ enum passed as the _status_ argument. If the
|
||
status already exists, a new BoolValue will not be created.
|
||
code_samples: []
|
||
parameters:
|
||
- name: status
|
||
type: Status
|
||
default: Poison
|
||
summary: ''
|
||
returns:
|
||
- type: boolean
|
||
summary: ''
|
||
tags:
|
||
- Deprecated
|
||
deprecation_message: |
|
||
This item is deprecated, as it was a part of the unfinished RbxStatus
|
||
library which would have allowed you to add conditions to a Humanoid. Do
|
||
not use it for new work.
|
||
security: None
|
||
thread_safety: Unsafe
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid:ApplyDescriptionAsync
|
||
summary: |
|
||
Makes the character's look match that of the passed in
|
||
`Class.HumanoidDescription`.
|
||
description: |
|
||
This yielding method makes the character's look match that of the passed
|
||
in `Class.HumanoidDescription`. A copy of the passed
|
||
`Class.HumanoidDescription` is cached as the `Class.HumanoidDescription`
|
||
for the `Class.Humanoid`.
|
||
|
||
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 `Class.HumanoidDescription` accurately. If you want
|
||
to use this method in conjunction with other means of updating the
|
||
character, `Class.Humanoid:ApplyDescriptionResetAsync()` will always
|
||
ensure the character reflects the passed in `Class.HumanoidDescription`.
|
||
|
||
#### See Also
|
||
|
||
- `Class.Humanoid:GetAppliedDescription()` which returns the
|
||
`Class.HumanoidDescription` currently applied to the humanoid.
|
||
- `Class.Players:GetHumanoidDescriptionFromUserIdAsync()` which returns a
|
||
`Class.HumanoidDescription` describing the avatar for the passed in
|
||
user.
|
||
- `Class.Players:GetHumanoidDescriptionFromOutfitIdAsync()` which returns
|
||
a `Class.HumanoidDescription` whose parameters are initialized to match
|
||
that of the passed in server-side outfit asset.
|
||
- `Class.Player:LoadCharacterWithHumanoidDescriptionAsync()` which spawns
|
||
a player with the look from the passed in `Class.HumanoidDescription`.
|
||
code_samples: []
|
||
parameters:
|
||
- name: humanoidDescription
|
||
type: HumanoidDescription
|
||
default:
|
||
summary: |
|
||
The `Class.HumanoidDescription` instance which you want to set the
|
||
character to match.
|
||
- name: assetTypeVerification
|
||
type: AssetTypeVerification
|
||
default: Default
|
||
summary: |
|
||
The asset type verification mode.
|
||
returns:
|
||
- type: ()
|
||
summary: ''
|
||
tags:
|
||
- Yields
|
||
deprecation_message: ''
|
||
security: None
|
||
thread_safety: Unsafe
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid:ApplyDescription
|
||
summary: |
|
||
Makes the character's look match that of the passed in
|
||
`Class.HumanoidDescription`.
|
||
description: ''
|
||
code_samples: []
|
||
parameters:
|
||
- name: humanoidDescription
|
||
type: HumanoidDescription
|
||
default:
|
||
summary: |
|
||
The `Class.HumanoidDescription` instance which you want to set the
|
||
character to match.
|
||
- name: assetTypeVerification
|
||
type: AssetTypeVerification
|
||
default: Default
|
||
summary: |
|
||
The asset type verification mode.
|
||
returns:
|
||
- type: ()
|
||
summary: ''
|
||
tags:
|
||
- Yields
|
||
- Deprecated
|
||
deprecation_message: |
|
||
This method has been superseded by
|
||
`Class.Humanoid:ApplyDescriptionAsync()|ApplyDescriptionAsync()`.
|
||
security: None
|
||
thread_safety: Unsafe
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid:ApplyDescriptionResetAsync
|
||
summary: |
|
||
Makes the character's look match that of the passed in
|
||
`Class.HumanoidDescription`, even after external changes.
|
||
description: |
|
||
This yielding method makes the character's look match that of the passed
|
||
in `Class.HumanoidDescription`, even after external changes. A copy of the
|
||
passed `Class.HumanoidDescription` is cached as the
|
||
`Class.HumanoidDescription` for the `Class.Humanoid`.
|
||
|
||
This method will always ensure the character reflects the passed in
|
||
`Class.HumanoidDescription`, even if changes have been made to the
|
||
character not using the `Class.HumanoidDescription` system (for example
|
||
not using
|
||
`Class.Humanoid:ApplyDescriptionResetAsync()|ApplyDescriptionResetAsync()`
|
||
or `Class.Humanoid:ApplyDescriptionAsync()|ApplyDescriptionAsync()`). This
|
||
is in contrast to
|
||
`Class.Humanoid:ApplyDescriptionAsync()|ApplyDescriptionAsync()` which is
|
||
optimized and may incorrectly apply a `Class.HumanoidDescription` if the
|
||
character has been changed by means other than through the
|
||
`Class.HumanoidDescription` system.
|
||
code_samples: []
|
||
parameters:
|
||
- name: humanoidDescription
|
||
type: HumanoidDescription
|
||
default:
|
||
summary: |
|
||
The `Class.HumanoidDescription` instance which you want to set the
|
||
character to match.
|
||
- name: assetTypeVerification
|
||
type: AssetTypeVerification
|
||
default: Default
|
||
summary: |
|
||
The asset type verification mode.
|
||
returns:
|
||
- type: ()
|
||
summary: ''
|
||
tags:
|
||
- Yields
|
||
deprecation_message: ''
|
||
security: None
|
||
thread_safety: Unsafe
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid:ApplyDescriptionReset
|
||
summary: |
|
||
Makes the character's look match that of the passed in
|
||
`Class.HumanoidDescription`, even after external changes.
|
||
description: ''
|
||
code_samples: []
|
||
parameters:
|
||
- name: humanoidDescription
|
||
type: HumanoidDescription
|
||
default:
|
||
summary: |
|
||
The `Class.HumanoidDescription` instance which you want to set the
|
||
character to match.
|
||
- name: assetTypeVerification
|
||
type: AssetTypeVerification
|
||
default: Default
|
||
summary: |
|
||
The asset type verification mode.
|
||
returns:
|
||
- type: ()
|
||
summary: ''
|
||
tags:
|
||
- Yields
|
||
- Deprecated
|
||
deprecation_message: |
|
||
This method has been superseded by
|
||
`Class.Humanoid:ApplyDescriptionResetAsync()|ApplyDescriptionResetAsync()`.
|
||
security: None
|
||
thread_safety: Unsafe
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid:BuildRigFromAttachments
|
||
summary: |
|
||
Assembles a tree of `Class.Motor6D` joints by attaching together
|
||
`Class.Attachment` objects in a humanoid's character.
|
||
description: |
|
||
This method assembles a tree of `Class.Motor6D` joints for the
|
||
`Class.Humanoid`. `Class.Motor6D` joints are required for the playback of
|
||
`Class.Animation|Animations`.
|
||
|
||
Starting from the humanoid's `Class.Humanoid.RootPart|RootPart`, this
|
||
method collects all `Class.Attachment|Attachments` parented 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, a `Class.Motor6D` joint is
|
||
generated based on the parts associated with the two attachments and the
|
||
`Class.Attachment.CFrame|CFrame` of the attachments.
|
||
|
||
`Class.Humanoid:BuildRigFromAttachments()` also scales the character and
|
||
sets body colors.
|
||
code_samples:
|
||
- Humanoid-BuildRigFromAttachments-Port
|
||
- R15-Package-Importer
|
||
parameters: []
|
||
returns:
|
||
- type: ()
|
||
summary: ''
|
||
tags: []
|
||
deprecation_message: ''
|
||
security: None
|
||
thread_safety: Unsafe
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid:ChangeState
|
||
summary: |
|
||
Sets the `Class.Humanoid` to enter the given `Enum.HumanoidStateType`.
|
||
description: |
|
||
This method causes the `Class.Humanoid` to enter the given
|
||
`Enum.HumanoidStateType`, describing the activity the `Class.Humanoid` is
|
||
currently doing.
|
||
|
||
Please review the `Enum.HumanoidStateType` page for more information on
|
||
the particular states, as some have unintuitive names. For example,
|
||
`Enum.HumanoidStateType.Running` describes a state where the humanoid's
|
||
legs are on the ground, including when stationary.
|
||
|
||
Due to the default behavior of the `Class.Humanoid`, some states will
|
||
automatically be changed when set. For example:
|
||
|
||
- Setting the state to `Enum.HumanoidStateType.Swimming` when the humanoid
|
||
is not in the water will cause it to be automatically set to
|
||
`Enum.HumanoidStateType.GettingUp`.
|
||
- As it is unused, setting the state to
|
||
`Enum.HumanoidStateType.PlatformStanding` will cause the humanoid state
|
||
to be automatically set to `Enum.HumanoidStateType.Running`.
|
||
|
||
Note that in order to set the `Class.Humanoid` state using this method,
|
||
you must do so from a `Class.LocalScript` and the client must have
|
||
[network ownership](../../../physics/network-ownership.md) of the
|
||
`Class.Player.Character`. Alternatively, you can call this method from a
|
||
server-side `Class.Script`, but the server must have network ownership of
|
||
the player character.
|
||
|
||
See also `Class.Humanoid:SetStateEnabled()` to enable or disable a
|
||
particular state, and `Class.Humanoid:GetState()` to get the current
|
||
humanoid state.
|
||
code_samples:
|
||
- double-jump
|
||
parameters:
|
||
- name: state
|
||
type: HumanoidStateType
|
||
default: None
|
||
summary: |
|
||
The `Enum.HumanoidStateType` that the `Class.Humanoid` is to perform.
|
||
returns:
|
||
- type: ()
|
||
summary: ''
|
||
tags: []
|
||
deprecation_message: ''
|
||
security: None
|
||
thread_safety: Unsafe
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid:EquipTool
|
||
summary: |
|
||
Makes the `Class.Humanoid` equip the given `Class.Tool`.
|
||
description: |
|
||
This method makes the `Class.Humanoid` equip the given `Class.Tool`.
|
||
|
||
When this method is called, the `Class.Humanoid` will first automatically
|
||
unequip all `Class.Tool|Tools` that it currently has equipped.
|
||
|
||
Although they will be equipped, `Class.Tool|Tools` for which
|
||
`Class.Tool.RequiresHandle` is `true` will not function if they have no
|
||
handle, regardless if this method is used to equip them or not.
|
||
|
||
See also `Class.Humanoid:UnequipTools()`.
|
||
code_samples: []
|
||
parameters:
|
||
- name: tool
|
||
type: Instance
|
||
default:
|
||
summary: |
|
||
The `Class.Tool` to equip.
|
||
returns:
|
||
- type: ()
|
||
summary: ''
|
||
tags: []
|
||
deprecation_message: ''
|
||
security: None
|
||
thread_safety: Unsafe
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid:GetAccessories
|
||
summary: |
|
||
Returns an array of `Class.Accessory` objects that the humanoid's parent
|
||
is currently wearing.
|
||
description: |
|
||
This method returns an array of `Class.Accessory` objects that the
|
||
humanoid's parent is currently wearing. All such `Class.Accessory` objects
|
||
will be included, regardless of whether they're attached or not.
|
||
|
||
If the `Class.Humanoid` has no `Class.Accessory` objects, an empty array
|
||
will be returned.
|
||
|
||
See also `Class.Humanoid:AddAccessory()` to attach an `Class.Accessory` to
|
||
a humanoid's parent.
|
||
code_samples:
|
||
- remove-accessories-after-loading
|
||
parameters: []
|
||
returns:
|
||
- type: Array
|
||
summary: |
|
||
An array of `Class.Accessory` objects that are parented to the
|
||
humanoid's parent.
|
||
tags: []
|
||
deprecation_message: ''
|
||
security: None
|
||
thread_safety: Unsafe
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid:GetAppliedDescription
|
||
summary: |
|
||
Returns a copy of the humanoid's cached `Class.HumanoidDescription` which
|
||
describes its current look.
|
||
description: |
|
||
This method returns a copy of the humanoid's cached
|
||
`Class.HumanoidDescription` which describes its current look. This can be
|
||
used to quickly determine a character's look and to assign their look to
|
||
other characters using the `Class.Humanoid:ApplyDescriptionAsync()`
|
||
method.
|
||
|
||
#### See Also
|
||
|
||
- `Class.Players:GetHumanoidDescriptionFromUserIdAsync()` which returns a
|
||
`Class.HumanoidDescription` describing the avatar for the passed in
|
||
user.
|
||
- `Class.Players:GetHumanoidDescriptionFromOutfitIdAsync()` which returns
|
||
a `Class.HumanoidDescription` whose parameters are initialized to match
|
||
that of the passed in server-side outfit asset.
|
||
- `Class.Player:LoadCharacterWithHumanoidDescriptionAsync()` which spawns
|
||
a player with the look from the passed in `Class.HumanoidDescription`.
|
||
code_samples: []
|
||
parameters: []
|
||
returns:
|
||
- type: HumanoidDescription
|
||
summary: ''
|
||
tags: []
|
||
deprecation_message: ''
|
||
security: None
|
||
thread_safety: Unsafe
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid:GetBodyPartR15
|
||
summary: |
|
||
Pass a body part to this method (the body part should be a sibling of
|
||
Humanoid, and a child of a Model) to get the `Enum.BodyPartR15` of the
|
||
`Class.Part`.
|
||
description: |
|
||
This method returns what `Enum.BodyPartR15` a `Class.Part` is, or
|
||
`Enum.BodyPartR15.Unknown` if 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 `Class.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.
|
||
code_samples: []
|
||
parameters:
|
||
- name: part
|
||
type: Instance
|
||
default:
|
||
summary: |
|
||
The specified part being checked to see if it is an R15 body part.
|
||
returns:
|
||
- type: BodyPartR15
|
||
summary: |
|
||
The specified part's R15 body part type or unknown if the part is not
|
||
a body part.
|
||
tags: []
|
||
deprecation_message: ''
|
||
security: None
|
||
thread_safety: Unsafe
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid:GetLimb
|
||
summary: |
|
||
Returns the `Enum.Limb` enum that is associated with the given
|
||
`Class.Part`.
|
||
description: |
|
||
This method returns the `Enum.Limb` enum that is associated with the given
|
||
`Class.Part`. It works for both R15 and R6 rigs, for example:
|
||
|
||
```lua
|
||
-- 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.LeftLeg
|
||
```
|
||
|
||
Note that `Class.Humanoid:GetLimb()` will throw an error if the part's
|
||
parent is not set to the humanoid's parent.
|
||
code_samples:
|
||
- Humanoid-GetLimb1
|
||
parameters:
|
||
- name: part
|
||
type: Instance
|
||
default:
|
||
summary: |
|
||
The `Class.Part` for which the `Enum.Limb|Enum.Limb` is to be
|
||
retrieved.
|
||
returns:
|
||
- type: Limb
|
||
summary: |
|
||
The `Enum.Limb` the part corresponds with.
|
||
tags: []
|
||
deprecation_message: ''
|
||
security: None
|
||
thread_safety: Unsafe
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid:GetMoveVelocity
|
||
summary: ''
|
||
description: ''
|
||
code_samples: []
|
||
parameters: []
|
||
returns:
|
||
- type: Vector3
|
||
summary: ''
|
||
tags: []
|
||
deprecation_message: ''
|
||
security: None
|
||
thread_safety: Unsafe
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid:GetPlayingAnimationTracks
|
||
summary: |
|
||
Returns an array of all `Class.AnimationTrack|AnimationTracks` that are
|
||
currently being played on the `Class.Humanoid`.
|
||
description: |
|
||
This method returns an array of all `Class.AnimationTrack|AnimationTracks`
|
||
that are currently being played on the `Class.Humanoid`. A typical use for
|
||
this method is stopping currently playing tracks using
|
||
`Class.AnimationTrack:Stop()`.
|
||
|
||
Beware that this method will not return
|
||
`Class.AnimationTrack|AnimationTracks` that have loaded but are **not
|
||
playing**. If you want to track these you will need to index them
|
||
manually.
|
||
code_samples: []
|
||
parameters: []
|
||
returns:
|
||
- type: Array
|
||
summary: |
|
||
An array of currently playing `Class.AnimationTrack|AnimationTracks`.
|
||
tags:
|
||
- Deprecated
|
||
deprecation_message: ''
|
||
security: None
|
||
thread_safety: Unsafe
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid:GetState
|
||
summary: |
|
||
Returns the humanoid's current `Enum.HumanoidStateType`.
|
||
description: |
|
||
This method returns the humanoid's current `Enum.HumanoidStateType`,
|
||
describing the activity the `Class.Humanoid` is currently doing, such as
|
||
jumping or swimming.
|
||
|
||
See also `Class.Humanoid:SetStateEnabled()` to enable or disable a
|
||
particular state, and `Class.Humanoid:ChangeState()` to change the current
|
||
humanoid state.
|
||
code_samples:
|
||
- double-jump
|
||
parameters: []
|
||
returns:
|
||
- type: HumanoidStateType
|
||
summary: |
|
||
The current `Enum.HumanoidStateType` of the `Class.Humanoid`.
|
||
tags: []
|
||
deprecation_message: ''
|
||
security: None
|
||
thread_safety: Safe
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid:GetStateEnabled
|
||
summary: |
|
||
Returns whether a `Enum.HumanoidStateType` is enabled for the
|
||
`Class.Humanoid`.
|
||
description: |
|
||
The GetStateEnabled method returns whether a `Enum.HumanoidStateType` is
|
||
enabled for the `Class.Humanoid`.
|
||
|
||
The humanoid state describes the activity the humanoid is currently doing.
|
||
|
||
When a particular `Enum.HumanoidStateType` is disabled, the humanoid can
|
||
never enter that state. This is true regardless if the attempt to change
|
||
state is made using `Class.Humanoid:ChangeState()` or Roblox internal
|
||
humanoid code.
|
||
|
||
See also:
|
||
|
||
- For an event that fires when a humanoid state is enabled or disabled see
|
||
`Class.Humanoid.StateEnabledChanged`
|
||
- To enable or disable a `Class.Humanoid` state use
|
||
`Class.Humanoid:SetStateEnabled()`
|
||
code_samples:
|
||
- setting-and-getting-humanoid-states
|
||
parameters:
|
||
- name: state
|
||
type: HumanoidStateType
|
||
default:
|
||
summary: |
|
||
The given `Enum.HumanoidStateType`.
|
||
returns:
|
||
- type: boolean
|
||
summary: |
|
||
Whether the given `Enum.HumanoidStateType` is enabled.
|
||
tags: []
|
||
deprecation_message: ''
|
||
security: None
|
||
thread_safety: Safe
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid:GetStatuses
|
||
summary: |
|
||
Returns a table of the Humanoid's statuses, and custom statuses.
|
||
description: |
|
||
The GetStatuses method returns a table of the Humanoid's statuses, and
|
||
custom statuses.
|
||
code_samples: []
|
||
parameters: []
|
||
returns:
|
||
- type: Array
|
||
summary: ''
|
||
tags:
|
||
- Deprecated
|
||
deprecation_message: |
|
||
This item is deprecated, as it was a part of the unfinished RbxStatus
|
||
library which would have allowed you to add conditions to a Humanoid. Do
|
||
not use it for new work.
|
||
security: None
|
||
thread_safety: Unsafe
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid:HasCustomStatus
|
||
summary: |
|
||
Returns boolean based on if custom statuses exist.
|
||
description: |
|
||
The HasCustomStatus method returns boolean based on if custom statuses
|
||
exist.
|
||
code_samples: []
|
||
parameters:
|
||
- name: status
|
||
type: string
|
||
default:
|
||
summary: ''
|
||
returns:
|
||
- type: boolean
|
||
summary: ''
|
||
tags:
|
||
- Deprecated
|
||
deprecation_message: |
|
||
This item is deprecated, as it was a part of the unfinished RbxStatus
|
||
library which would have allowed you to add conditions to a Humanoid. Do
|
||
not use it for new work.
|
||
security: None
|
||
thread_safety: Unsafe
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid:HasStatus
|
||
summary: |
|
||
Returns a boolean based on if a status exists.
|
||
description: |
|
||
The HasStatus method returns a boolean based on if a status exists.
|
||
code_samples: []
|
||
parameters:
|
||
- name: status
|
||
type: Status
|
||
default: Poison
|
||
summary: ''
|
||
returns:
|
||
- type: boolean
|
||
summary: ''
|
||
tags:
|
||
- Deprecated
|
||
deprecation_message: |
|
||
This item is deprecated, as it was a part of the unfinished RbxStatus
|
||
library which would have allowed you to add conditions to a Humanoid. Do
|
||
not use it for new work.
|
||
security: None
|
||
thread_safety: Unsafe
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid:LoadAnimation
|
||
summary: |
|
||
Loads an `Class.Animation` onto a `Class.Humanoid`, returning an
|
||
`Class.AnimationTrack` that can be used for playback.
|
||
description: |
|
||
This method loads an `Class.Animation` onto a `Class.Humanoid`, returning
|
||
an `Class.AnimationTrack` that can be used for playback.
|
||
code_samples: []
|
||
parameters:
|
||
- name: animation
|
||
type: Animation
|
||
default:
|
||
summary: |
|
||
The `Class.Animation` to load.
|
||
returns:
|
||
- type: AnimationTrack
|
||
summary: ''
|
||
tags:
|
||
- Deprecated
|
||
deprecation_message: |
|
||
This function is deprecated in favor of using
|
||
`Class.Animator:LoadAnimation()` directly (the `Class.Animator` may be
|
||
created while editing or at runtime).
|
||
security: None
|
||
thread_safety: Unsafe
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid:loadAnimation
|
||
summary: ''
|
||
description: ''
|
||
code_samples: []
|
||
parameters:
|
||
- name: animation
|
||
type: Animation
|
||
default:
|
||
summary: ''
|
||
returns:
|
||
- type: AnimationTrack
|
||
summary: ''
|
||
tags:
|
||
- Deprecated
|
||
deprecation_message: |
|
||
This deprecated method is a variant of `Class.Humanoid:LoadAnimation()`.
|
||
`Class.Animator:LoadAnimation()` should be used instead.
|
||
security: None
|
||
thread_safety: Unsafe
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid:Move
|
||
summary: |
|
||
Causes the `Class.Humanoid` to walk in the given direction.
|
||
description: |
|
||
This method causes the `Class.Humanoid` to walk in the given
|
||
`Datatype.Vector3` direction.
|
||
|
||
By default, the direction is in world terms, but if the `relativeToCamera`
|
||
parameter is `true`, the direction is relative to the `Datatype.CFrame` of
|
||
the `Class.Workspace.CurrentCamera|CurrentCamera`. As the negative **Z**
|
||
direction is considered "forwards" in Roblox, the following code will make
|
||
the humanoid walk in the direction of the
|
||
`Class.Workspace.CurrentCamera|CurrentCamera`.
|
||
|
||
```lua
|
||
humanoid:Move(Vector3.new(0, 0, -1), true)
|
||
```
|
||
|
||
When this method is called, the `Class.Humanoid` will 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 using
|
||
`Class.RunService:BindToRenderStep()` (see example), or overwriting the
|
||
control scripts in `Class.StarterPlayerScripts`.
|
||
|
||
This method can be called on the server, but this should only be done when
|
||
the server has [network ownership](../../../physics/network-ownership.md)
|
||
of the humanoid's assembly.
|
||
|
||
See also `Class.Humanoid:MoveTo()` which makes a`Class.Humanoid` walk to a
|
||
point, and `Class.Player:Move()` which effectively calls this function.
|
||
code_samples:
|
||
- moving-a-humanoid-forwards
|
||
parameters:
|
||
- name: moveDirection
|
||
type: Vector3
|
||
default:
|
||
summary: |
|
||
The direction to walk in.
|
||
- name: relativeToCamera
|
||
type: boolean
|
||
default: false
|
||
summary: |
|
||
Set to `true` if the `moveDirection` parameter should be taken as
|
||
relative to the `Class.Workspace.CurrentCamera|CurrentCamera`.
|
||
returns:
|
||
- type: ()
|
||
summary: ''
|
||
tags: []
|
||
deprecation_message: ''
|
||
security: None
|
||
thread_safety: Unsafe
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid:MoveTo
|
||
summary: |
|
||
Causes the `Class.Humanoid` to attempt to walk to the given location by
|
||
setting the `Class.Humanoid.WalkToPoint` and `Class.Humanoid.WalkToPart`
|
||
properties.
|
||
description: |
|
||
This method causes the `Class.Humanoid` to attempt to walk to a given
|
||
location by setting the `Class.Humanoid.WalkToPoint|WalkToPoint` and
|
||
`Class.Humanoid.WalkToPart|WalkToPart` properties, corresponding to the
|
||
`location` and `part` parameters.
|
||
|
||
If the `part` parameter is specified, the `Class.Humanoid` will still
|
||
attempt to walk to the `location` parameter's point. However, if the
|
||
`part` moves, 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 `Class.Humanoid.MoveToFinished|MoveToFinished`
|
||
to fire). If you don't want this to happen, call `MoveTo()` at a repeated
|
||
interval so that the timeout keeps resetting.
|
||
|
||
`Class.Humanoid:MoveTo()|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 `Class.Humanoid.WalkToPoint|WalkToPoint` or
|
||
`Class.Humanoid.WalkToPart|WalkToPart` changes.
|
||
|
||
- A script calls `Class.Humanoid:Move()|Move()` with a new `moveDirection`
|
||
parameter.
|
||
|
||
- A script changes the `Class.BasePart.CFrame|CFrame` property of the
|
||
humanoid's `Class.Humanoid.RootPart|RootPart`.
|
||
code_samples:
|
||
- humanoid-moveto-without-time-out
|
||
parameters:
|
||
- name: location
|
||
type: Vector3
|
||
default:
|
||
summary: |
|
||
The position to set `Class.Humanoid.WalkToPoint` to.
|
||
- name: part
|
||
type: Instance
|
||
default: nil
|
||
summary: |
|
||
The `Class.BasePart` to set `Class.Humanoid.WalkToPart` to.
|
||
returns:
|
||
- type: ()
|
||
summary: ''
|
||
tags: []
|
||
deprecation_message: ''
|
||
security: None
|
||
thread_safety: Unsafe
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid:PlayEmoteAsync
|
||
summary: |
|
||
Plays emotes and returns if was successfully ran.
|
||
description: |
|
||
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.
|
||
code_samples: []
|
||
parameters:
|
||
- name: emoteName
|
||
type: string
|
||
default:
|
||
summary: |
|
||
name of the emote to play.
|
||
returns:
|
||
- type: boolean
|
||
summary: |
|
||
successfully played.
|
||
tags:
|
||
- Yields
|
||
deprecation_message: ''
|
||
security: None
|
||
thread_safety: Unsafe
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid:PlayEmote
|
||
summary: |
|
||
Plays emotes and returns if was successfully ran.
|
||
description: ''
|
||
code_samples: []
|
||
parameters:
|
||
- name: emoteName
|
||
type: string
|
||
default:
|
||
summary: |
|
||
name of the emote to play.
|
||
returns:
|
||
- type: boolean
|
||
summary: |
|
||
successfully played.
|
||
tags:
|
||
- Yields
|
||
- Deprecated
|
||
deprecation_message: |
|
||
This method has been superseded by
|
||
`Class.Humanoid:PlayEmoteAsync()|PlayEmoteAsync()`.
|
||
security: None
|
||
thread_safety: Unsafe
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid:RemoveAccessories
|
||
summary: |
|
||
Removes all `Class.Accessory` objects worn by the humanoid's parent.
|
||
description: |
|
||
This method removes all `Class.Accessory` objects worn by the humanoid's
|
||
parent. For player `Class.Player.Character|Characters`, this will remove
|
||
all hats and other accessories.
|
||
|
||
This method removes `Class.Accessory` object by calling
|
||
`Class.Instance:Destroy()` on them, meaning the
|
||
`Class.Instance.Parent|Parent` of the accessories are set to `nil` and
|
||
locked.
|
||
|
||
See also `Class.Humanoid:AddAccessory()` to attach an `Class.Accessory`,
|
||
and `Class.Humanoid:GetAccessories()` to get all `Class.Accessory` objects
|
||
belonging to a `Class.Humanoid`.
|
||
code_samples:
|
||
- remove-accessories-after-loading
|
||
parameters: []
|
||
returns:
|
||
- type: ()
|
||
summary: ''
|
||
tags: []
|
||
deprecation_message: ''
|
||
security: None
|
||
thread_safety: Unsafe
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid:RemoveCustomStatus
|
||
summary: |
|
||
Removes the defined custom status from the Status model in the Humanoid..
|
||
description: |
|
||
The RemoveCustomStatus method removes the defined custom status from the
|
||
Status model in the Humanoid..
|
||
code_samples: []
|
||
parameters:
|
||
- name: status
|
||
type: string
|
||
default:
|
||
summary: ''
|
||
returns:
|
||
- type: boolean
|
||
summary: ''
|
||
tags:
|
||
- Deprecated
|
||
deprecation_message: |
|
||
This item is deprecated, as it was a part of the unfinished RbxStatus
|
||
library which would have allowed you to add conditions to a Humanoid. Do
|
||
not use it for new work.
|
||
security: None
|
||
thread_safety: Unsafe
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid:RemoveStatus
|
||
summary: |
|
||
Removes the defined status from the Status model in the Humanoid.
|
||
description: |
|
||
The RemoveStatus method removes the defined status from the Status model
|
||
in the Humanoid.
|
||
code_samples: []
|
||
parameters:
|
||
- name: status
|
||
type: Status
|
||
default: Poison
|
||
summary: ''
|
||
returns:
|
||
- type: boolean
|
||
summary: ''
|
||
tags:
|
||
- Deprecated
|
||
deprecation_message: |
|
||
This item is deprecated, as it was a part of the unfinished RbxStatus
|
||
library which would have allowed you to add conditions to a Humanoid. Do
|
||
not use it for new work.
|
||
security: None
|
||
thread_safety: Unsafe
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid:ReplaceBodyPartR15
|
||
summary: |
|
||
Dynamically replaces a Humanoid body part with a different part.
|
||
description: |
|
||
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
|
||
`Class.Humanoid:GetBodyPartR15()|GetBodyPartR15` can 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.
|
||
code_samples: []
|
||
parameters:
|
||
- name: bodyPart
|
||
type: BodyPartR15
|
||
default:
|
||
summary: |
|
||
The body part to replace. `Enum.BodyPartR15.Unknown` will fail.
|
||
- name: part
|
||
type: BasePart
|
||
default:
|
||
summary: |
|
||
The `Class.Part` `Class.Instance` which will be parented to the
|
||
character.
|
||
returns:
|
||
- type: boolean
|
||
summary: ''
|
||
tags: []
|
||
deprecation_message: ''
|
||
security: None
|
||
thread_safety: Unsafe
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid:SetStateEnabled
|
||
summary: |
|
||
Sets whether a given `Enum.HumanoidStateType` is enabled for the
|
||
`Class.Humanoid`.
|
||
description: |
|
||
This method sets whether a given `Enum.HumanoidStateType` is enabled for
|
||
the `Class.Humanoid`. When a particular `Enum.HumanoidStateType` is
|
||
disabled, the `Class.Humanoid` can never enter that state. This is true
|
||
regardless if the attempt to change state is made using
|
||
`Class.Humanoid:ChangeState()` or Roblox internal `Class.Humanoid` code.
|
||
|
||
Note that using `SetStateEnabled()` on the server does not replicate the
|
||
change to the client, nor vice-versa.
|
||
code_samples:
|
||
- jump-cooldown
|
||
parameters:
|
||
- name: state
|
||
type: HumanoidStateType
|
||
default:
|
||
summary: |
|
||
The `Enum.HumanoidStateType` to be enabled or disabled.
|
||
- name: enabled
|
||
type: boolean
|
||
default:
|
||
summary: |
|
||
`true` if `state` is to be enabled, `false` if `state` is to be
|
||
disabled.
|
||
returns:
|
||
- type: ()
|
||
summary: ''
|
||
tags: []
|
||
deprecation_message: ''
|
||
security: None
|
||
thread_safety: Unsafe
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid:TakeDamage
|
||
summary: |
|
||
Lowers the `Class.Humanoid.Health` of the `Class.Humanoid` by the given
|
||
_amount_ if it is not protected by a `Class.ForceField`.
|
||
description: |
|
||
This method lowers the `Class.Humanoid.Health` of the `Class.Humanoid` by
|
||
the given _amount_ if it is not protected by a `Class.ForceField`
|
||
|
||
This method accepts negative values for the _amount_ parameter. This will
|
||
increase the humanoid's `Class.Humanoid.Health`. However this will only
|
||
have an effect if no `Class.ForceField` is present.
|
||
|
||
#### How do ForceFields protect against TakeDamage
|
||
|
||
A `Class.Humanoid` is considered protected by a `Class.ForceField` if a
|
||
`Class.ForceField` meets one of the following criteria:
|
||
|
||
- The `Class.ForceField` shares the same `Class.Instance.Parent` as the
|
||
`Class.Humanoid`
|
||
- The `Class.ForceField` is parented to the `Class.Humanoid.RootPart` of
|
||
the `Class.Humanoid`
|
||
- The `Class.ForceField` is parented to an ancestor of the
|
||
`Class.Humanoid` other than the `Class.Workspace`
|
||
|
||
To do damage to a `Class.Humanoid` irrespective of any
|
||
`Class.ForceField|ForceFields` present, set `Class.Humanoid.Health`
|
||
directly.
|
||
|
||
For more information on how `Class.ForceField|ForceFields` protect
|
||
`Class.Humanoid|Humanoids` see the `Class.ForceField` page.
|
||
code_samples:
|
||
- Humanoid-TakeDamage1
|
||
parameters:
|
||
- name: amount
|
||
type: float
|
||
default:
|
||
summary: |
|
||
The damage, or amount to be deduced from the `Class.Humanoid.Health`.
|
||
returns:
|
||
- type: ()
|
||
summary: ''
|
||
tags: []
|
||
deprecation_message: ''
|
||
security: None
|
||
thread_safety: Unsafe
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid:takeDamage
|
||
summary: ''
|
||
description: ''
|
||
code_samples: []
|
||
parameters:
|
||
- name: amount
|
||
type: float
|
||
default:
|
||
summary: ''
|
||
returns:
|
||
- type: ()
|
||
summary: ''
|
||
tags:
|
||
- Deprecated
|
||
deprecation_message: |
|
||
This deprecated method is a variant of `Class.Humanoid:TakeDamage()`,
|
||
which should be used instead.
|
||
security: None
|
||
thread_safety: Unsafe
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid:UnequipTools
|
||
summary: |
|
||
Unequips any `Class.Tool` currently equipped by the `Class.Humanoid`.
|
||
description: |
|
||
This method unequips any `Class.Tool` currently equipped by the
|
||
`Class.Humanoid`. The unequipped `Class.Tool` will be parented to the
|
||
`Class.Backpack` of the `Class.Player` associated with the
|
||
`Class.Humanoid`.
|
||
|
||
If no `Class.Tool` is equipped, this method will do nothing.
|
||
|
||
Although `Class.Tool|Tools` can be equipped by NPCs, this method only
|
||
works on `Class.Humanoid|Humanoids` with a corresponding `Class.Player`,
|
||
as a `Class.Backpack` object is required to parent the unequipped
|
||
`Class.Tool` to.
|
||
|
||
See also `Class.Humanoid:EquipTool()`.
|
||
code_samples: []
|
||
parameters: []
|
||
returns:
|
||
- type: ()
|
||
summary: ''
|
||
tags: []
|
||
deprecation_message: ''
|
||
security: None
|
||
thread_safety: Unsafe
|
||
capabilities:
|
||
- Avatar
|
||
events:
|
||
- name: Humanoid.AnimationPlayed
|
||
summary: |
|
||
Fires when an `Class.AnimationTrack` begins playing on the
|
||
`Class.Humanoid`.
|
||
description: |
|
||
The AnimationPlayed event fires when an `Class.AnimationTrack` begins
|
||
playing on the `Class.Humanoid`.
|
||
|
||
A common use for this function is to connect the
|
||
`Class.AnimationTrack.KeyframeReached` event for the playing
|
||
AnimationTrack, so additional effects can be added to the animation (for
|
||
example `Class.Sound|Sounds` and
|
||
`Class.ParticleEmitter|ParticleEmitters`).
|
||
|
||
This event can be used for any `Class.Humanoid` regardless if it belongs
|
||
to the local player's client or not.
|
||
|
||
See also:
|
||
|
||
- For the `Class.AnimationController` equivalent of this event, please see
|
||
`Class.AnimationController.AnimationPlayed`
|
||
code_samples:
|
||
- pausing-an-animation-when-a-keyframe-is-reached
|
||
parameters:
|
||
- name: animationTrack
|
||
type: AnimationTrack
|
||
default:
|
||
summary: |
|
||
The `Class.AnimationTrack` that has begun playing.
|
||
tags:
|
||
- Deprecated
|
||
deprecation_message: ''
|
||
security: None
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid.ApplyDescriptionFinished
|
||
summary: ''
|
||
description: ''
|
||
code_samples: []
|
||
parameters:
|
||
- name: description
|
||
type: HumanoidDescription
|
||
default:
|
||
summary: ''
|
||
tags: []
|
||
deprecation_message: ''
|
||
security: None
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid.Climbing
|
||
summary: |
|
||
Fires when the speed at which a `Class.Humanoid` is climbing changes.
|
||
description: |
|
||
Fires when the speed at which a `Class.Humanoid` is climbing changes.
|
||
|
||
`Class.Humanoid|Humanoids` can climb up ladders made out of
|
||
`Class.BasePart|Parts` or `Class.TrussPart|TrussParts`.
|
||
|
||
`Class.Humanoid|Humanoids` climb at 70% of their
|
||
`Class.Humanoid.WalkSpeed`.
|
||
|
||
This event will not always fire with a speed of 0 when the
|
||
`Class.Humanoid` stops climbing.
|
||
|
||
See also:
|
||
|
||
- For swimming and running see the `Class.Humanoid.Swimming` and
|
||
`Class.Humanoid.Running` events
|
||
- You can also detect when a `Class.Humanoid` is climbing using the
|
||
`Class.Humanoid.StateChanged` event
|
||
- You can disable climbing using the `Class.Humanoid:SetStateEnabled()`
|
||
function
|
||
code_samples:
|
||
- Humanoid-Climbing1
|
||
parameters:
|
||
- name: speed
|
||
type: float
|
||
default:
|
||
summary: |
|
||
The speed at which the `Class.Humanoid` is currently climbing.
|
||
tags: []
|
||
deprecation_message: ''
|
||
security: None
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid.CustomStatusAdded
|
||
summary: |
|
||
Fired when a status is added to the Humanoid.
|
||
description: |
|
||
The CustomStatusAdded event fires when a status is added to the Humanoid
|
||
via the `Class.Humanoid:AddCustomStatus()` method.
|
||
code_samples: []
|
||
parameters:
|
||
- name: status
|
||
type: string
|
||
default:
|
||
summary: ''
|
||
tags:
|
||
- Deprecated
|
||
deprecation_message: |
|
||
This item is deprecated, as it was a part of the unfinished RbxStatus
|
||
library which would have allowed you to add conditions to a Humanoid. Do
|
||
not use it for new work.
|
||
security: None
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid.CustomStatusRemoved
|
||
summary: |
|
||
Fired when a status is removed from the Humanoid.
|
||
description: |
|
||
The CustomStatusRemoved event fires when a status is removed from the
|
||
Humanoid via the `Class.Humanoid:RemoveCustomStatus()` method.
|
||
code_samples: []
|
||
parameters:
|
||
- name: status
|
||
type: string
|
||
default:
|
||
summary: ''
|
||
tags:
|
||
- Deprecated
|
||
deprecation_message: |
|
||
This item is deprecated, as it was a part of the unfinished RbxStatus
|
||
library which would have allowed you to add conditions to a Humanoid. Do
|
||
not use it for new work.
|
||
security: None
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid.Died
|
||
summary: |
|
||
Fires when the `Class.Humanoid` dies.
|
||
description: |
|
||
This event fires when the `Class.Humanoid` dies, usually when
|
||
`Class.Humanoid.Health` reaches 0. This could be caused either by
|
||
disconnecting their head from their `Class.Humanoid.Torso`, or directly
|
||
setting the health property.
|
||
|
||
This event only fires if the `Class.Humanoid` is a descendant of the
|
||
`Class.Workspace`. If the `Dead` `Enum.HumanoidStateType` is disabled it
|
||
will not fire.
|
||
code_samples:
|
||
- Humanoid-Died1
|
||
parameters: []
|
||
tags: []
|
||
deprecation_message: ''
|
||
security: None
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid.FallingDown
|
||
summary: |
|
||
Fires when the `Class.Humanoid` enters or leaves the `FallingDown`
|
||
`Enum.HumanoidStateType`.
|
||
description: |
|
||
The FallingDown event fires when the `Class.Humanoid` enters and leaves
|
||
the `FallingDown` `Enum.HumanoidStateType`.
|
||
|
||
The `Class.Humanoid` will enter the `GettingUp` state 3 seconds after the
|
||
`FallingDown` state is enabled. When this happens this event will fire
|
||
with an _active_ value of _false_, and `Class.Humanoid.GettingUp` will
|
||
fire with an _active_ value of _true_.
|
||
code_samples: []
|
||
parameters:
|
||
- name: active
|
||
type: boolean
|
||
default:
|
||
summary: |
|
||
Describes whether the `Class.Humanoid` is entering or leaving the
|
||
`FallingDown` `Enum.HumanoidStateType`.
|
||
tags: []
|
||
deprecation_message: ''
|
||
security: None
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid.FreeFalling
|
||
summary: |
|
||
Fires when the `Class.Humanoid` enters or leaves the `Freefall`
|
||
`Enum.HumanoidStateType`.
|
||
description: |
|
||
This event fires when the `Class.Humanoid` enters or leaves the `Freefall`
|
||
`Enum.HumanoidStateType`.
|
||
|
||
The _active_ parameter represents whether the `Class.Humanoid` is entering
|
||
or leaving the `Freefall` state.
|
||
|
||
Although the `Freefall` state generally ends when the `Class.Humanoid`
|
||
reaches the ground, this event may fire with _active_ equal to _false_ if
|
||
the state is changed while the `Class.Humanoid` is falling. For this
|
||
reason, you should use `Class.Humanoid.StateChanged` and listen for the
|
||
`Landed` state to work out when a `Class.Humanoid` has landed.
|
||
code_samples: []
|
||
parameters:
|
||
- name: active
|
||
type: boolean
|
||
default:
|
||
summary: |
|
||
Whether the `Class.Humanoid` is entering or leaving the `Freefall`
|
||
`Enum.HumanoidStateType`.
|
||
tags: []
|
||
deprecation_message: ''
|
||
security: None
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid.GettingUp
|
||
summary: |
|
||
Fires when the `Class.Humanoid` enters or leaves the `GettingUp`
|
||
`Enum.HumanoidStateType`.
|
||
description: |
|
||
This event fires when the `Class.Humanoid` enters or leaves the
|
||
`Enum.HumanoidStateType.GettingUp` state, a transition state that is
|
||
activated shortly after the `Class.Humanoid` enters the
|
||
`Enum.HumanoidStateType.FallingDown|FallingDown` (3 seconds) or
|
||
`Enum.HumanoidStateType.Ragdoll|Ragdoll` (1 second) states.
|
||
|
||
When a `Class.Humanoid` attempts to get back up, this event will first
|
||
fire with an `active` parameter of `true` before shortly after firing
|
||
again with an `active` parameter of `false`.
|
||
|
||
To force a `Class.Humanoid` to fall over, use the
|
||
`Class.Humanoid:ChangeState()` function with
|
||
`Enum.HumanoidStateType.FallingDown`.
|
||
code_samples: []
|
||
parameters:
|
||
- name: active
|
||
type: boolean
|
||
default:
|
||
summary: |
|
||
Whether the `Class.Humanoid` is entering or leaving the `GettingUp`
|
||
`Enum.HumanoidStateType`.
|
||
tags: []
|
||
deprecation_message: ''
|
||
security: None
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid.HealthChanged
|
||
summary: |
|
||
Fires when the `Class.Humanoid.Health` changes (or when the
|
||
`Class.Humanoid.MaxHealth` is set).
|
||
description: |
|
||
This event fires when the `Class.Humanoid.Health` changes. However, it
|
||
will not fire if the health is increasing from a value equal to or greater
|
||
than the `Class.Humanoid.MaxHealth`.
|
||
|
||
When `Class.Humanoid.Health` reaches zero, the `Class.Humanoid` will die
|
||
and the `Class.Humanoid.Died` event will fire. This event will fire with a
|
||
value of zero.
|
||
code_samples:
|
||
- Humanoid-HealthChanged1
|
||
- Health-Bar
|
||
parameters:
|
||
- name: health
|
||
type: float
|
||
default:
|
||
summary: |
|
||
The new value of `Class.Humanoid.Health`.
|
||
tags: []
|
||
deprecation_message: ''
|
||
security: None
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid.Jumping
|
||
summary: |
|
||
Fires when the `Class.Humanoid` enters and leaves the `Jumping`
|
||
`Enum.HumanoidStateType`.
|
||
description: |
|
||
This event fires when the `Class.Humanoid` enters and leaves the `Jumping`
|
||
`Enum.HumanoidStateType`.
|
||
|
||
When a `Class.Humanoid` jumps, this event fires with an `active` parameter
|
||
of `true` before shortly afterwards firing again with an `active`
|
||
parameter of `false`. This second firing does not correspond with a
|
||
`Class.Humanoid` landing; for that, listen for the `Landed`
|
||
`Enum.HumanoidStateType` using `Class.Humanoid.StateChanged`.
|
||
|
||
You can disable jumping using the `Class.Humanoid:SetStateEnabled()`
|
||
function.
|
||
code_samples: []
|
||
parameters:
|
||
- name: active
|
||
type: boolean
|
||
default:
|
||
summary: |
|
||
Whether the `Class.Humanoid` is entering or leaving the `Jumping`
|
||
`Enum.HumanoidStateType`.
|
||
tags: []
|
||
deprecation_message: ''
|
||
security: None
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid.MoveToFinished
|
||
summary: |
|
||
Fires when the `Class.Humanoid` finishes walking to a goal declared by
|
||
`Class.Humanoid:MoveTo()`.
|
||
description: |
|
||
This event fires when the `Class.Humanoid` finishes walking to a goal
|
||
declared by the `Class.Humanoid.WalkToPoint` and
|
||
`Class.Humanoid.WalkToPart` properties.
|
||
|
||
The `Class.Humanoid.WalkToPoint` and `Class.Humanoid.WalkToPart`
|
||
properties can be set individually, or using the `Class.Humanoid:MoveTo()`
|
||
function.
|
||
|
||
If the `Class.Humanoid` reaches its goal within 8 seconds, this event will
|
||
return with _reached_ as true. If the goal is not reached within 8 seconds
|
||
the `Class.Humanoid` will stop walking and _reached_ will be false. This
|
||
timeout can be reset be calling `Class.Humanoid:MoveTo()` again within the
|
||
timeout period.
|
||
code_samples:
|
||
- humanoid-moveto-without-time-out
|
||
parameters:
|
||
- name: reached
|
||
type: boolean
|
||
default:
|
||
summary: |
|
||
A boolean indicating whether the `Class.Humanoid` reached is goal.
|
||
_True_ if the `Class.Humanoid` is reached its goal, _false_ if the
|
||
walk timed out before the goal could be reached.
|
||
tags: []
|
||
deprecation_message: ''
|
||
security: None
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid.PlatformStanding
|
||
summary: |
|
||
Fires when the `Class.Humanoid` enters or leaves the `PlatformStanding`
|
||
`Enum.HumanoidStateType`.
|
||
description: |
|
||
This event fires when the `Class.Humanoid` enters or leaves the
|
||
`PlatformStanding` `Enum.HumanoidStateType`.
|
||
|
||
Whilst the `Class.Humanoid` is in the `PlatformStanding` state, the
|
||
`Class.Humanoid.PlatformStand` property will be _true_.
|
||
|
||
Whilst `Class.Humanoid.PlatformStand` is set to _true_, the
|
||
`Class.Humanoid` will be unable to move. For more information please see
|
||
the page for `Class.Humanoid.PlatformStand`.
|
||
|
||
The PlatformStand `Enum.HumanoidStateType` was associated with the now
|
||
disabled `Class.Platform` part. Despite this, it can still be used by
|
||
developers.
|
||
code_samples: []
|
||
parameters:
|
||
- name: active
|
||
type: boolean
|
||
default:
|
||
summary: |
|
||
Whether the `Class.Humanoid` is entering or leaving the
|
||
`PlatformStanding` `Enum.HumanoidStateType`.
|
||
tags: []
|
||
deprecation_message: ''
|
||
security: None
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid.Ragdoll
|
||
summary: |
|
||
Fires when the `Class.Humanoid` enters or leaves the `Ragdoll`
|
||
`Enum.HumanoidStateType`.
|
||
description: |
|
||
This event fires when the `Class.Humanoid` enters or leaves the `Ragdoll`
|
||
`Enum.HumanoidStateType`.
|
||
|
||
The `active` parameter will have the value `true` or `false` to indicate
|
||
entering or leaving.
|
||
|
||
Use `Class.Humanoid:SetStateEnabled()` to disable the GettingUp state to
|
||
stay in the Ragdoll state.
|
||
|
||
See also:
|
||
|
||
- `Class.Humanoid.FallingDown` for the `Class.Humanoid` event connected
|
||
with the `FallingDown` state, which behaves similarly to `Ragdoll`
|
||
code_samples: []
|
||
parameters:
|
||
- name: active
|
||
type: boolean
|
||
default:
|
||
summary: |
|
||
Whether the `Class.Humanoid` is entering or leaving the `Ragdoll`
|
||
`Enum.HumanoidStateType`.
|
||
tags: []
|
||
deprecation_message: ''
|
||
security: None
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid.Running
|
||
summary: |
|
||
Fires when the speed at which a `Class.Humanoid` is running changes.
|
||
description: |
|
||
This event fires when the speed at which a `Class.Humanoid` is running
|
||
changes.
|
||
|
||
While running `Class.Humanoid|Humanoids` cover, on average, their
|
||
`Class.Humanoid.WalkSpeed` in studs per second.
|
||
|
||
When the `Class.Humanoid` stops running this event will fire with a speed
|
||
of 0.
|
||
|
||
See also:
|
||
|
||
- For swimming and climbing see the `Class.Humanoid.Swimming` and
|
||
`Class.Humanoid.Climbing` events
|
||
- You can also detect when a `Class.Humanoid` is running using the
|
||
`Class.Humanoid.StateChanged` event
|
||
code_samples:
|
||
- Humanoid-Running1
|
||
parameters:
|
||
- name: speed
|
||
type: float
|
||
default:
|
||
summary: |
|
||
The speed at which the `Class.Humanoid` is running.
|
||
tags: []
|
||
deprecation_message: ''
|
||
security: None
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid.Seated
|
||
summary: |
|
||
Fired when a `Class.Humanoid` either sits in a `Class.Seat` or
|
||
`Class.VehicleSeat` or gets up.
|
||
description: |
|
||
This event fires when a `Class.Humanoid` either sits in or gets up from a
|
||
`Class.Seat` or `Class.VehicleSeat`.
|
||
|
||
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
|
||
`Class.Seat` page.
|
||
|
||
- If the character is sitting down, the `active` parameter will be
|
||
**true** and `currentSeatPart` will be the seat they are currently
|
||
sitting in.
|
||
- If the character got up from a seat, the `active` parameter will be
|
||
**false** and `currentSeatPart` will be `nil`.
|
||
|
||
See also:
|
||
|
||
- `Class.Humanoid.Sit`, which indicates if a Humanoid is currently sitting
|
||
- `Class.Humanoid.SeatPart`, which indicates the seat a Humanoid is
|
||
currently sitting in, if any.
|
||
code_samples:
|
||
- finding-a-player-s-seat
|
||
parameters:
|
||
- name: active
|
||
type: boolean
|
||
default:
|
||
summary: |
|
||
True if the `Class.Humanoid` is sitting down.
|
||
- name: currentSeatPart
|
||
type: BasePart
|
||
default:
|
||
summary: |
|
||
The seat the `Class.Humanoid` is sat in if it is sitting down.
|
||
tags: []
|
||
deprecation_message: ''
|
||
security: None
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid.StateChanged
|
||
summary: |
|
||
Fires when the state of the `Class.Humanoid` is changed.
|
||
description: |
|
||
This event fires when the state of the `Class.Humanoid` is changed.
|
||
|
||
As there is no "idle" humanoid state, you should instead use the
|
||
`Class.Humanoid.Running` event or listen to the
|
||
`Class.Humanoid.RootPart|RootPart` part's
|
||
`Class.BasePart.Velocity|Velocity` to work out when the `Class.Humanoid`
|
||
is standing still.
|
||
|
||
#### See Also
|
||
|
||
- `Class.Humanoid:GetState()` and `Class.Humanoid:ChangeState()` to get
|
||
and set the state.
|
||
- `Class.Humanoid:SetStateEnabled()` to enable and disable specific
|
||
states.
|
||
code_samples:
|
||
- jumping-particles
|
||
- jump-cooldown
|
||
parameters:
|
||
- name: old
|
||
type: HumanoidStateType
|
||
default:
|
||
summary: |
|
||
The humanoid's previous state type.
|
||
- name: new
|
||
type: HumanoidStateType
|
||
default:
|
||
summary: |
|
||
The humanoid's current state type.
|
||
tags: []
|
||
deprecation_message: ''
|
||
security: None
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid.StateEnabledChanged
|
||
summary: |
|
||
Fires when `Class.Humanoid:SetStateEnabled()` is called on the
|
||
`Class.Humanoid`.
|
||
description: |
|
||
The StateEnableChanged event fires when `Class.Humanoid:SetStateEnabled()`
|
||
is called on the `Class.Humanoid`.
|
||
|
||
Parameters include the `Enum.HumanoidStateType` in question along with a
|
||
bool indicating if this state is now enabled.
|
||
|
||
See also:
|
||
|
||
- To find if a state is currently enabled, use
|
||
`Class.Humanoid:GetStateEnabled()`
|
||
- To listen to `Class.Humanoid` state changes use
|
||
`Class.Humanoid.StateChanged`
|
||
code_samples:
|
||
- humanoid-state-change-detector
|
||
parameters:
|
||
- name: state
|
||
type: HumanoidStateType
|
||
default:
|
||
summary: |
|
||
The `Enum.HumanoidStateType` for which the enabled state has been
|
||
changed.
|
||
- name: isEnabled
|
||
type: boolean
|
||
default:
|
||
summary: |
|
||
True if the state is now enabled.
|
||
tags: []
|
||
deprecation_message: ''
|
||
security: None
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid.StatusAdded
|
||
summary: |
|
||
Fired when a status is added to the Humanoid.
|
||
description: |
|
||
The StatusAdded event fires when a status is added to the Humanoid.
|
||
code_samples:
|
||
- Humanoid-StatusAdded1
|
||
parameters:
|
||
- name: status
|
||
type: Status
|
||
default:
|
||
summary: ''
|
||
tags:
|
||
- Deprecated
|
||
deprecation_message: |
|
||
This item is deprecated, as it was a part of the unfinished RbxStatus
|
||
library which would have allowed you to add conditions to a Humanoid. Do
|
||
not use it for new work.
|
||
security: None
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid.StatusRemoved
|
||
summary: |
|
||
Fired when a status is removed from the Humanoid.
|
||
description: |
|
||
The StatusRemoved event fires when a status is removed from the Humanoid.
|
||
code_samples:
|
||
- Humanoid-StatusRemoved1
|
||
parameters:
|
||
- name: status
|
||
type: Status
|
||
default:
|
||
summary: ''
|
||
tags:
|
||
- Deprecated
|
||
deprecation_message: |
|
||
This item is deprecated, as it was a part of the unfinished RbxStatus
|
||
library which would have allowed you to add conditions to a Humanoid. Do
|
||
not use it for new work.
|
||
security: None
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid.Strafing
|
||
summary: |
|
||
Fires when the `Class.Humanoid` enters or leaves the `StrafingNoPhysics`
|
||
`Enum.HumanoidStateType`.
|
||
description: |
|
||
This event does not fire when the `Class.Humanoid` is strafing and should
|
||
not be used by developers
|
||
|
||
This event is fired when the `Class.Humanoid` enters or leaves the
|
||
`StrafingNoPhysics` `Enum.HumanoidStateType`.
|
||
|
||
When the `Class.Humanoid` enters the `StrafingNoPhysics` state this event
|
||
will fire with an _active_ parameter of _true_. The event will fire again
|
||
with _active_ equal to _false_ when the `Class.Humanoid` leaves the
|
||
`StrafingNoPhysics` state.
|
||
|
||
This event is associated with the `StrafingNoPhysics` `Class.Humanoid`
|
||
state and does **not** fire when the `Class.Humanoid` is moving
|
||
perpendicular to the direction it is facing. This state is currently
|
||
unused, if it is set using `Class.Humanoid:ChangeState()` the state will
|
||
revert to `RunningNoPhysics`.
|
||
code_samples: []
|
||
parameters:
|
||
- name: active
|
||
type: boolean
|
||
default:
|
||
summary: |
|
||
Whether the `Class.Humanoid` is entering or leaving the
|
||
`StrafingNoPhysics` `Enum.HumanoidStateType`.
|
||
tags: []
|
||
deprecation_message: ''
|
||
security: None
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid.Swimming
|
||
summary: |
|
||
Fires when the speed at which a `Class.Humanoid` is swimming in
|
||
`Class.Terrain` water changes.
|
||
description: |
|
||
This event fires when the speed at which a `Class.Humanoid` is swimming in
|
||
`Class.Terrain` water changes.
|
||
|
||
`Class.Humanoid|Humanoids` swim at 87.5% of their
|
||
`Class.Humanoid.WalkSpeed`.
|
||
|
||
This event will not always fire with a speed of 0 when the
|
||
`Class.Humanoid` stops swimming.
|
||
|
||
See also:
|
||
|
||
- For running and climbing see the `Class.Humanoid.Running` and
|
||
`Class.Humanoid.Climbing` events
|
||
- You can also detect when a `Class.Humanoid` is swimming using the
|
||
`Class.Humanoid.StateChanged` event
|
||
- You can disable swimming using the `Class.Humanoid:SetStateEnabled()`
|
||
function
|
||
code_samples: []
|
||
parameters:
|
||
- name: speed
|
||
type: float
|
||
default:
|
||
summary: |
|
||
The speed the `Class.Humanoid` is currently swimming at.
|
||
tags: []
|
||
deprecation_message: ''
|
||
security: None
|
||
capabilities:
|
||
- Avatar
|
||
- name: Humanoid.Touched
|
||
summary: |
|
||
Fires when one of the humanoid's limbs come in contact with another
|
||
`Class.BasePart`.
|
||
description: |
|
||
This event fires when one of the humanoid's limbs comes in contact with
|
||
another `Class.BasePart`. The `Class.BasePart` which the limb is touching,
|
||
along with the limb itself, is given.
|
||
|
||
This event will not fire when limbs belonging to the `Class.Humanoid` come
|
||
into contact with themselves.
|
||
|
||
#### Alternatives
|
||
|
||
Although the `Class.Humanoid.Touched` event is useful, you should consider
|
||
if there are alternatives that better suit your needs.
|
||
|
||
- In most cases, it's advised to connect a `Class.BasePart.Touched` event
|
||
for `Class.BasePart|BaseParts` of interest instead, as the
|
||
`Class.Humanoid.Touched` event will constantly fire when the humanoid is
|
||
moving. For example, in a dodgeball game, it would be more practical to
|
||
connect a `Class.BasePart.Touched|Touched` event for the balls rather
|
||
than use `Class.Humanoid.Touched`.
|
||
- When trying to work out when the `Class.Humanoid` has landed on the
|
||
ground, the `Class.Humanoid.StateChanged` event is more suitable.
|
||
Alternatively, you can check `Class.Humanoid.FloorMaterial` to see if
|
||
the humanoid is standing on any non-air material.
|
||
|
||
#### Notes
|
||
|
||
- Connecting to this event will cause a `Class.TouchTransmitter` to be
|
||
created in every limb.
|
||
- There is currently no equivalent of `Class.BasePart.TouchEnded` for
|
||
`Class.Humanoid|Humanoids`.
|
||
code_samples:
|
||
- midas-touch-2
|
||
parameters:
|
||
- name: touchingPart
|
||
type: BasePart
|
||
default:
|
||
summary: |
|
||
The `Class.BasePart` the `Class.Humanoid` has come in contact with.
|
||
- name: humanoidPart
|
||
type: BasePart
|
||
default:
|
||
summary: |
|
||
The limb of the `Class.Humanoid` that has been touched.
|
||
tags: []
|
||
deprecation_message: ''
|
||
security: None
|
||
capabilities:
|
||
- Avatar
|
||
callbacks: []
|