---
name: "setCompassOscillation"
type: command
status: ok
groups: ["Interaction"]
arma3_since: "0.50"
locality: {"argument": null, "effect": "local", "server_exec": false}
source: https://community.bistudio.com/wiki/setCompassOscillation
revid: 351911
updated: 2024-01-25T09:37:29Z
---

# setCompassOscillation

*Command · Interaction · Arma 3 v0.50*

Locality: effect **local**

## Description

This command sets random heading on the player's compass (both in map and in 3D view) with given frequency, which is also randomised.

## Syntax

```sqf
setCompassOscillation [angle, frequencyMin, frequencyMax]
```

**Parameters:**

- `angle`: [Number](../topics/Number.md) - heading deviation angle in [rad](../commands/rad.md)ians; the random angle will be picked up from `[-angle...+angle]` range
- `frequencyMin`: [Number](../topics/Number.md) - lower bound of heading change in seconds
- `frequencyMax`: [Number](../topics/Number.md) - higher bound of heading change in seconds

**Returns:** [Nothing](../topics/Nothing.md)

## Examples

### Example 1

Set compass to oscillate every second within -90/+90 degrees:

```sqf
setCompassOscillation [rad 90, 1, 1];
```

### Example 2

Change heading every 60 to 90 seconds:

```sqf
setCompassOscillation [rad 180, 60, 90];
```

### Example 3

Make compass go crazy:

```sqf
setCompassOscillation [rad 360, 0.1, 0.2];
```

### Example 4

Reset to default behaviour:

```sqf
setCompassOscillation [-1, 0, 0];
```

## See also

[visibleCompass](../commands/visibleCompass.md) · [shownCompass](../commands/shownCompass.md) · [shownCuratorCompass](../commands/shownCuratorCompass.md) · [showCompass](../commands/showCompass.md) · [showCuratorCompass](../commands/showCuratorCompass.md) · [setCompassDeclination](../commands/setCompassDeclination.md)

<sub>Source: [BI Community Wiki — setCompassOscillation](https://community.bistudio.com/wiki/setCompassOscillation) (revision 351911).</sub>
