# FlyController

Class · extends [`InputController`](https://api.playcanvas.com/engine/classes/InputController.md) · category: Input

Source: https://github.com/playcanvas/engine/blob/970d89f6d3bc6667f4e1f88153abd6e7e82ed52c/src/extras/input/controllers/fly-controller.js#L27

The fly controller. Free flight: `rotate` deltas turn the pose about yaw and pitch, limited by
[yawRange](https://api.playcanvas.com/engine/classes/FlyController.md#yawrange) and [pitchRange](https://api.playcanvas.com/engine/classes/FlyController.md#pitchrange), and `move` deltas translate it along its own right, up
and forward axes, so movement follows where the camera looks. Motion is smoothed with
[rotateDamping](https://api.playcanvas.com/engine/classes/FlyController.md#rotatedamping) and [moveDamping](https://api.playcanvas.com/engine/classes/FlyController.md#movedamping).

## Properties

### moveDamping

```ts
moveDamping: number = 0.98
```

The movement damping. In the range 0 to 1, where a value of 0 means no damping and 1 means
full damping. Default is 0.98.

### rotateDamping

```ts
rotateDamping: number = 0.98
```

The rotation damping. In the range 0 to 1, where a value of 0 means no damping and 1 means
full damping. Default is 0.98.

## Accessors

### pitchRange

```ts
get pitchRange(): Vec2
set pitchRange(value: Vec2)
```

### yawRange

```ts
get yawRange(): Vec2
set yawRange(value: Vec2)
```

## Methods

### attach

```ts
attach(pose: Pose, smooth?: boolean): void
```

**Parameters**

- `pose` ([`Pose`](https://api.playcanvas.com/engine/classes/Pose.md)): The initial pose of the controller.
- `smooth` (`boolean`, optional, default `true`): Whether to smooth the transition.

### destroy

```ts
destroy(): void
```

### detach

```ts
detach(): void
```

### update

```ts
update(frame: InputFrame<{ move: number[]; rotate: number[] }>, dt: number): Pose
```

**Parameters**

- `frame` ([`InputFrame`](https://api.playcanvas.com/engine/classes/InputFrame.md)`<{ move: number[]; rotate: number[] }>`): The input frame.
- `dt` (`number`): The delta time.

**Returns** [`Pose`](https://api.playcanvas.com/engine/classes/Pose.md): - The controller pose.

## Inherited from [InputController](https://api.playcanvas.com/engine/classes/InputController.md)

- `new FlyController()`
- `protected _pose: Pose`
