# setPedAnalogControlState (Client)

> Presses one of a ped's analog controls only partly, for example to make it walk slowly or steer gently.

- **Platform**: MY Multiplayer (MYMP)
- **Kind**: Lua Function
- **Side**: Client
- **Category**: Controls
- **URL**: https://wiki.mymp.gg/en/setPedAnalogControlState

## Syntax

```lua
bool setPedAnalogControlState(ped thePed, string control, float state)
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `thePed` | `ped` | The ped. For any element, the function also applies to the elements below it, and the result is the element's own. |
| `control` | `string` | An analog control: `left`, `right`, `forwards`, `backwards`, `vehicle_left`, `vehicle_right`, `steer_forward`, `steer_back`, `accelerate`, `brake_reverse`, `special_control_left`, `special_control_right`, `special_control_up` or `special_control_down`. |
| `state` | `float` | How far to press it, from 0 to 1. Values outside are clamped. |

## Returns

`true` if the state was applied. `false` if the control name does not exist, the control is not analog or the element is not a ped.

Pressing a control releases its opposite: `forwards` clears `backwards`, `left` clears `right` and so on.

## Example

```lua
local ped = createPed("male01", 2495.0, -1685.0, 13.5)
setPedAnalogControlState(ped, "forwards", 0.4)
setPedControlState(ped, "walk", true)
```

### Note

Only peds move with it. On a player, the local one included, the function returns `true` but does nothing; for the local player, use `setControlState`.

## See also

- [getPedAnalogControlState (Client)](https://wiki.mymp.gg/en/getPedAnalogControlState.md): Tells how far one of a ped's controls is pressed, from 0 to 1. It is meant for analog controls such as walking, steering and accelerating.
- [setPedControlState (Client)](https://wiki.mymp.gg/en/setPedControlState.md): Presses or releases one of a ped's controls as if it were a key, for example to make it walk, jump or shoot.
- [setControlState (Client)](https://wiki.mymp.gg/en/setControlState-client.md): Presses or releases one of a ped's controls as if it were a key, for example to make it walk, jump or shoot.
