# Mobile Joystick

## Overview

This component is in charge of calculating the resulting Vector2 Axis from moving a UI Joystick.

Use the sample prefab provided as starting point.

![](https://963537199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lzhr1XSMzMqNXjRnNlb%2F-MKc1dUYpz_TKfl_HBIc%2F-MKc2Js2z8TTxCQtw1qS%2FKzGQ79vjFm.gif?alt=media\&token=9998fce6-bfec-4f59-bcca-cdc057620ec6)

## Parameters

![](https://963537199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lzhr1XSMzMqNXjRnNlb%2F-MKbbaBKzXXtBiNCAtJA%2F-MKbrmv54H8LtMxvIK-y%2Fimage.png?alt=media\&token=b60cd0a1-7e51-4f1f-b938-0aedbcda475b)

### Invert X

Inverts the Horizontal value of the Joystick

### Invert Y

Inverts the Horizontal value of the Joystick

### Drag

If true, then the joystick will not use the starting position as guide for calculating the movement axis. Useful for making an area Joystick. E.g. Camera Area Joystick Prefab.

### Death Point

If the Axis Magnitude is lower than this value then the Axis will zero out

### Sensitivity X

Multiplier value for the Horizontal movement. Higher values more&#x20;

### Sensitivity Y

Multiplier value for the Vertical movement

## References

All References values are the internal values of the Joystick component logic. They can be used as scriptable variables so they can be used by other components

### Axis Value

Axis value of the  Joystick. X -> Horizontal value; Y -> Vertical Value

### Pressed

Store whether if the joystick is pressed or not

## Events

![](https://963537199-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-Lzhr1XSMzMqNXjRnNlb%2F-MKbbaBKzXXtBiNCAtJA%2F-MKbrvl8o48Wo_7VIhaI%2Fimage.png?alt=media\&token=65d1bb61-eead-4bd9-aa60-181bfdbaa07c)

### On Joystick Down

Invoked when the joystick is pressed down.

### On Joystick Up

Invoked when the joystick is released.

### On Joystick Pressed (bool)

Invoked when the joystick changes its press value (True: Press Down, False: Released)

### On Axis Change (Vector2)

Invoked the axis value of the Joystick. X -> Horizontal value; Y -> Vertical Value

### On X Axis Change

Invoked when the Horizontal(X)  value of the Joystick changes.

### On Y Axis Change&#x20;

Invoked when the Vertical(Y)  value of the Joystick changes.
