# Humanoid

Humanoid : `Instance`

## Overview

The humanoid object is a core component that enables a simple model instance to behave like an actual character, allowing it to perform basic movements like walking or jumping and interact with various objects in the game.

The humanoid belongs under the category of the top-level Model (Character) and consists of the humanoid controlling the character's behavior and state, the HumanoidRootPart serving as the character's center, six MeshParts comprising the head, torso, arms, and legs, and a Skeleton with 22 Bones.

## Properties

### AirControl

`number`

Defines how responsive a humanoid is to movement input while in the air. The default is 0.9.

The closer the value is to 0, the harder it is to change direction while jumping or falling, and the closer it is to 1, the more ground-like control you will feel even in the air.

#### Code Samples

```lua
Humanoid.AirControl = 0.5
```

### AutomaticScalingEnabled

`bool`

Currently not supported.

#### Code Samples

### BlendSpace

`BlendSpace`

This property specifies the blendspace to use.

Blendspace is a feature that enables interpolation of multiple animations based on parameters such as character speed or direction of movement, creating smooth transitions and animations blended appropriate to the context.

#### Code Samples

```lua
Humanoid.BlendSpace = BasicBlendSpace
```

### CameraOffset

`Vector3`

Instead of this property, it is recommended to use the CameraOffset property of the Camera.

#### Code Samples

### CapsuleHeight

`number`

Specifies the vertical height of the capsule responsible for collision detection of the humanoid. The default is 164.

Only affects the collision area regardless of the character's actual mesh size, with larger values ​​making the character behave as if it has a larger collider.

#### Code Samples

```lua
Humanoid.CapsuleHeight = 82
```

### CapsuleRadius

`number`

Defines the radius of the humanoid's collision capsule. The default is 24.

Reduce the value to pass through narrow passages or small spaces, or raise it to widen the collision detection range, giving it a wider range of interaction with other objects.

#### Code Samples

```lua
Humanoid.CapsuleRadius = 12
```

### CharacterMeshPos

`Vector3`

This property specifies how much to offset the humanoid's mesh position from the reference coordinates. The default is `(0, -85, 0)`.

This is often used to correct the alignment between the character mesh and the collision capsule, or to slightly move the appearance in a custom rig.

#### Code Samples

```lua
Humanoid.CharacterMeshPos = Vector3.new(0, -1, 0)
```

### DefaultBlendSpace

`BlendSpace`

{Description Slot}

#### Code Samples

```lua
Humanoid.DefaultBlendSpace = BasicBlendSpace
```

### DisplayDistanceType

`Enum.HumanoidDisplayDistanceType`

{Description Slot}

#### Code Samples

### FallingDeceleration

`number`

This property controls how much speed decreases when the humanoid is falling in the air. The default is 2,500.

If the value is 0, no additional deceleration is applied during a fall, and a larger value gradually reduces speed during the fall, creating a smoother landing sensation.

#### Code Samples

```lua
Humanoid.FallingDeceleration = 0
```

### FallingLateralFriction

`number`

Defines the friction coefficient applied when the humanoid moves left and right in the air. The default is 16.

If the value is small, the lateral movement during a fall feel smooth, and if it is large, the direction changes in the air will be controlled more quickly.

#### Code Samples

```lua
Humanoid.FallingLateralFriction = 32
```

### GravityScale

`number`

This property specifies the gravity multiplier applied to the humanoid. The default is 2.1.

A higher value makes the character fall faster and jump lower, while a lower value gives the sensation of staying airborne longer.

#### Code Samples

```lua
Humanoid.GravityScale = 1
```

### GroundFriction

`number`

Indicates the friction coefficient applied when the humanoid moves on the ground. The default is 16.

It closely relates to the perceived friction when the character changes direction, and a lower value increases the slippery feel during turns, while a higher value results in sharper direction changes.

#### Code Samples

```lua
Humanoid.GroundFriction = 5
```

### Health

`number`

This property indicates the humanoid's current health.

The value is valid only between 0 and MaxHealth, and values outside this range are automatically adjusted to fit within it.

If the character dies (in Dead state), this value is forcibly set to 0. It is recommended to use the TakeDamage() method to reduce health rather than manually modifying the property.

When health reaches 0, the humanoid automatically transitions to the Dead state, and even when changed to the Dead state via the ChangeState() method, the Health value is set to 0.

#### Code Samples

```lua
Humanoid.Health = 0
```

### HitboxType

`Enum.HitboxType`

This property defines how the humanoid's hit judgment is determined.

The default is Single, which wraps the entire character with a single capsule-shaped hitbox and does not support hit detection on individual body parts.

When set to SixBody or FittedSixBody, it creates hitboxes fixed to major body parts such as the head, torso, arms, and legs, allowing for judgment for each body part. In particular, FittedSixBody has hitboxes that are precisely adjusted to match the character's appearance and the clothes worn.

This value needs to be configured in the Workspace in advance. It cannot be modified at runtime while the game is running. Therefore, this property must be configured during the editing phase in the Studio.

#### Code Samples

```lua
print(Humanoid.HitBoxType)
```

### IgnoreBaseRotation

`bool`

This property controls whether the rotation of the floor the humanoid is standing on is reflected in input and camera.

The default is true, and in this state, even if the character is on a rotating platform, it physically rotates with it, but the input direction and camera are not affected.

Conversely, setting this value to `false` causes the floor rotation to affect both the character and the camera, giving the sensation that the character's control direction and viewpoint rotate together.

#### Code Samples

```lua
print(Humanoid.IgnoreBaseRotation)
Humanoid.IgnoreBaseRotation = false
```

### Jump

`bool`

This property indicates whether the humanoid is attempting a jump action.

If this value is set to true, the humanoid transitions to a jumping state, and it automatically returns to false when the jump is completed or canceled midway.

It is automatically set to true by player input (spacebar, touch gestures, etc.), but the value can also be set manually via a script to forcibly trigger a jump.

#### Code Samples

```lua
print(Humanoid.Jump)
```

### JumpHeight

`number`

Determines the maximum height (in cm) that the humanoid can reach when jumping. The default is 135.

Setting this property to 0 will prevent the Humanoid from jumping, but to completely restrict jumping, it is recommended to use the Humanoid:SetStateEnabled() method to disable the Jumping state rather than changing the value.

> ℹ️ **OVERDARE Studio Defaults:**\
> In the Studio, JumpHeight is used as the default jump property, and unless changed by the creator, jump motion is calculated based on this value instead of JumpPower.

#### Code Samples

```lua
Humanoid.JumpHeight = 200
```

### JumpPower

`number`

This property defines the amount of upward force applied when the humanoid jumps.

The default is 400, and the actual jump height is also affected by the gravity value set in Workspace.Gravity.

Setting this property to 0 prevents the humanoid from jumping, but to completely diable jumping, it is recommended to use the Humanoid:SetStateEnabled() method to disable the Jumping state rather than changing this value.

#### Code Samples

```lua
Humanoid.JumpPower = 1000
```

### LookCameraDirection

`bool`

This property specifies whether the camera will follow the direction the humanoid character is facing.

It is recommended to use UserGameSettings.RotationType instead of this property.

#### Code Samples

```lua
Humanoid.LookCameraDirection = true
```

### MaxAcceleration

`number`

This property defines the maximum speed at which the humanoid can accelerate to on the ground.

A higher value makes the character more quickly respond to input and reach top speed instantly, while a lower value makes the character's movements gradual and heavy.

This is often used to adjust the game's controls (light vs. heavy).

#### Code Samples

```lua
Humanoid.MaxAcceleration = 1500
```

### MaxHealth

`number`

This property specifies the maximum health of the humanoid.

#### Code Samples

```lua
print(Humanoid.MaxHealth)
```

### MaxJumpCount

`number`

This property specifies the maximum number of consecutive jumps the humanoid can make. The default is 1, meaning only an ordinary single jump is possible.

Setting the value to 2 or higher enables double jumps or more, and setting it to 0 disables jumping entirely.

#### Code Samples

```lua
Humanoid.MaxJumpCount = 2
```

### MaxSlopeAngle

`number`

Defines the maximum slope angle the humanoid can climb.

The default is 45, and steeper slopes prevents the humanoid from sliding or moving, while lower values ​​only allows movement on flatter terrain.

#### Code Samples

```lua
Humanoid.MaxSlopeAngle = 60
```

### RootPart

`BasePart`

This property points to the HumanoidRootPart, the central part of the humanoid. (Read-only)

This part plays the role of a reference point that controls the character's walking or running movements in 3D space, and is usually not visible on the screen.

#### Code Samples

```lua
print(Humanoid.RootPart)
```

### RotationSpeed

`number`

Defines the speed in degrees (º) at which the humanoid can rotate per second(s). The default is 3,000.

Lowering the value makes the character turn more slowly when changing direction, while raising it makes the character turn more immediately.

#### Code Samples

```lua
Humanoid.RotationSpeed = 180
```

### StompJumpMultiplier

`number`

This property specifies the jump multiplier applied when the humanoid **steps on another character**. The default is 0, meaning that stepping on another character does not result in an additional bounce.

Setting the value to 1 or higher causes the character to bounce at a height similar to a normal jump when stepping on it, while larger values ​​creates a stronger bounce effect.

#### Code Samples

```lua
Humanoid.StompJumpMultiplier = 1.5
```

### UseJumpPower

`bool`

This property specifies whether the humanoid uses the JumpPower value when calculating the jump height. The default is false, and JumpHeight is applied by default.

When set to true, the jump height is determined by the combination of JumpPower and Workspace.Gravity values.

#### Code Samples

```lua
Humanoid.UseJumpPower = true
Humanoid.JumpPower = 600
```

### WalkingDeceleration

`number`

Indicates the degree of deceleration when the humanoid stops moving. The default is 2,500.

A larger value causes the character to stop immediately, while a smaller value makes it stop gradually, as if sliding due to inertia.

#### Code Samples

```lua
Humanoid.WalkingDeceleration = 500
```

### WalkSpeed

`number`

This property defines the speed at which the humanoid can move per second. The default is 500.

In mobile environments, unlike when controlling with a keyboard in the Studio, the actual movement speed may be slower than the WalkSpeed value unless the joystick is fully tilted.

Setting this value to 0 immobilizes the character and nullifies input from players.

Additionally, OVERDARE's default animation script automatically adjusts the playback speed of walking and running animations to match the character's actual movement speed.

#### Code Samples

```lua
Humanoid.WalkSpeed = 4000
```

### WalkToPart

`BasePart`

This property is used when `Humanoid:MoveTo()` tracks a movement target relative to a specific part. Directly setting and using this property is currently not supported.

#### Code Samples

### WalkToPoint

`Vector3`

This property represents the target position that the Humanoid moves toward when `Humanoid:MoveTo()` is called. When `WalkToPoint` is specified, the Humanoid moves to that position.

#### Code Samples

## Methods

### ApplyDescription

Changes the character's appearance to match the entered HumanoidDescription information.

The HumanoidDescription object is copied and stored in the humanoid, where it is later used to define the character's appearance.

#### Parameters

| `HumanoidDescription` InDescription                  | The appearance information to set.                                                                                                                |
| ---------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Enum.AssetTypeVerification` InAssetTypeVerification | <p>This property specifies how to validate assets included in the appearance information.<br>(Currently only the default value is supported.)</p> |

#### Return

| `void` |   |
| ------ | - |

#### Code Samples

```lua
local Workspace = game:GetService("Workspace")
local HumanoidDescription = Workspace:WaitForChild("HumanoidDescription")
Humanoid:ApplyDescription(HumanoidDescription, Enum.AssetTypeVerification.Default)
```

### ChangeState

Alters the current action by transitioning the humanoid's state to the specified HumanoidStateType value.

However, due to the nature of humanoid actions, some states may not be applied. For example, setting its state to Landed will not work while it is in the air.

State changes should be handled by LocalScript.

#### Parameters

| `Enum.HumanoidStateType` StateType | The state to change to. |
| ---------------------------------- | ----------------------- |

#### Return

| `void` |   |
| ------ | - |

#### Code Samples

```lua
Humanoid:ChangeState(Enum.HumanoidStateType.Physics)
```

### EquipTool

Allows the humanoid to equip the given tool.

If another tool is already equipped, it needs to be unequipped first before equipping the newly given tool.

#### Parameters

| `Instance` InTool | The tool to equip. |
| ----------------- | ------------------ |

#### Return

| `void` |   |
| ------ | - |

#### Code Samples

```lua
Humanoid:EquipTool(Tool)
```

### GetAppliedDescription

Returns the appearance information (HumanoidDescription) applied to the humanoid.

You can check the current character's appearance configuration through the returned object, and if necessary, you can apply the same appearance to another character using the ApplyDescription() method.

Returns nil if no appearance information is set.

#### Parameters

#### Return

| `HumanoidDescription` | Returns the set appearance information. |
| --------------------- | --------------------------------------- |

#### Code Samples

```lua
local Description = Humanoid:GetAppliedDescription()
```

### GetState

Returns the current behavioral state of the humanoid as a HumanoidStateType value, which can be used to determine which action the character is performing, such as jumping, falling, or running.

#### Parameters

#### Return

| `Value` |   |
| ------- | - |

#### Code Samples

```lua
print(Humanoid:GetState())
```

### LoadAnimation

(deprecated) Loads a specific animation to apply to the humanoid, and returns an AnimationTrack object that can be played and controlled.

This method is no longer recommended; use Animator:LoadAnimation() instead.

#### Parameters

| `Animation` InAnimation | The animation to use. |
| ----------------------- | --------------------- |

#### Return

| `AnimationTrack` | The returned animation track. |
| ---------------- | ----------------------------- |

#### Code Samples

```lua
local Animation = Instance.new("Animation")
Animation.AnimationId = "ovdrassetid://18850100" -- WinAnimation01

local AnimationTrack = Humanoid:LoadAnimation(Animation)

AnimationTrack:Play()
```

### MoveTo

Moves PC or NPC to specified coordinates at WalkSpeed.

For PC, MoveTo() will be cancelled if the player inputs movement while it is moving to a destination.

#### Parameters

| `Vector3` InPosition    |   |
| ----------------------- | - |
| `BasePart` InWalkToPart |   |

#### Return

| \`\` |   |
| ---- | - |

#### Code Samples

### SetStateEnabled

Controls whether the humanoid can enter the specified HumanoidStateType state.

If you disable a particular state, the humanoid will not transition to that state even if your script calls ChangeState() or conditions are met.

This is often used to prevent jumping or disable the Climb state. Some states, such as Running, cannot be controlled by this method.

#### Parameters

| `Enum.HumanoidStateType` InHumanoidStateType | The state to enable or not. |
| -------------------------------------------- | --------------------------- |
| `bool` bInEnabled                            | Whether enabled or not.     |

#### Return

| `void` |   |
| ------ | - |

#### Code Samples

```lua
Humanoid:SetStateEnabled(Enum.HumanoidStateType.Climbing, false)
```

### TakeDamage

Reduces the humanoid's health by the specified amount, and passing a negative value restores health.

#### Parameters

| `number` InDamage | This value applies to stamina. If positive, it reduces stamina; if negative, it restores stamina. |
| ----------------- | ------------------------------------------------------------------------------------------------- |

#### Return

| `void` |   |
| ------ | - |

#### Code Samples

```lua
Humanoid:TakeDamage(100)
```

### UnequipTools

Removes all tools currently equipped by the humanoid.

#### Parameters

#### Return

| `void` |   |
| ------ | - |

#### Code Samples

```lua
Humanoid:UnequipTools()
```

## Events

### Climbing

This event is executed when the humanoid transitions to the Climb state.

#### Parameters

#### Code Samples

```lua
local function OnClimbing()
    print("Climbing!")
end
Humanoid.Climbing:Connect(OnClimbing)
```

### Died

This event is executed when the humanoid transitions to the Dead state, usually when its health reaches 0.

#### Parameters

#### Code Samples

```lua
local function OnDied()
    print("Die!")
end
Humanoid.Died:Connect(OnDied)
```

### FreeFalling

This event is executed when the humanoid enters the Freefall state, usually when falling in the air.

#### Parameters

#### Code Samples

```lua
local function OnFreeFalling()
    print("FreeFalling!")
end		
Humanoid.FreeFalling:Connect(OnFreeFalling)
```

### HealthChanged

This event is executed whenever the humanoid's health changes, and is also called when it transitions to the Dead state after its health reaches 0.

#### Parameters

| `number` Health | The changed health. |
| --------------- | ------------------- |

#### Code Samples

```lua
local function OnHealthChanged(health)
    print("HealthChanged!", health)
end		
Humanoid.HealthChanged:Connect(OnHealthChanged)
```

### Jumping

This event is executed when the humanoid transitions to the Jumping state.

#### Parameters

#### Code Samples

```lua
local function OnJumping()
    print("Jumping!")
end		
Humanoid.Jumping:Connect(OnJumping)
```

### Landed

This event is executed when the humanoid transitions to the Landed state.

#### Parameters

#### Code Samples

```lua
local function OnLanded()
    print("Landed!")
end		
Humanoid.Landed:Connect(Landed)
```

### MoveToFinished

An event that triggers when a character reaches the coordinates passed as parameters by calling Humanoid:MoveTo().

When the character reaches its destination and the event is triggered, “reached” is passed as true. If the character fails to reach its destination within 8 seconds, the event is triggered as well, but “reached” is passed as false.

If MoveTo() is called multiple times, the previous MoveTo() calls will be cancelled without triggering the event; only the most recently called MoveTo() triggers the event.

Player input that cancels MoveTo() also prevents this event from being triggered.

#### Parameters

#### Code Samples

```lua
local function OnMoveToFinished(reached)
    print("Reached result: ", reached)
end
Humanoid.MoveToFinished:Connect(OnMoveToFinished)
```

### Running

This event is executed when the humanoid transitions to the Running state.

#### Parameters

#### Code Samples

```lua
local function OnRunning()
    print("Running!")
end		
Humanoid.Running:Connect(OnRunning)
```

### StateChanged

This event is executed when the humanoid transitions to a different action state.

However, since there is no separate idle state, you must manually check the velocity (AssemblyLinearVelocity) of the RootPart to determine if the character is stationary.

#### Parameters

| `Enum.HumanoidStateType` PreviousState | The state before change. |
| -------------------------------------- | ------------------------ |
| `Enum.HumanoidStateType` CurrentState  | The state after change.  |

#### Code Samples

```lua
local function OnStateChanged(prevState, newState)
    print("StateChanged!", prevState, "->", newState)
end		
Humanoid.StateChanged:Connect(OnStateChanged)
```

### Swimming

This event is executed when the humanoid transitions to the Swimming state.

#### Parameters

#### Code Samples

```lua
local function OnSwimming()
    print("Swimming!")
end		
Humanoid.Swimming:Connect(OnSwimming)
```

## See also

{% content-ref url="../../../manual/studio-manual/character" %}
[character](https://docs.overdare.com/manual/studio-manual/character)
{% endcontent-ref %}
