# TouchSticks

The following TouchStick Actions have been included in the Asset.

| Action Name                        | Description                                                        |
| ---------------------------------- | ------------------------------------------------------------------ |
| **Set Static Touchstick**          | Adds the Static Touchstick and allows for single tap Action        |
| **Set Dynamic Touchstick**         | Adds the Dynamic Touchstick                                        |
| **Hide TouchStick**                | Hides either the Static or Dynamic Touchstick                      |
| **Resize TouchStick**              | Resizes either the Static or Dynamic Touchstick                    |
| **Set Static Camera Touchstick**   | Adds the Static Camera Touchstick and allows for single tap Action |
| **Hide Static Camera TouchStick**  | Hides the Static Camera Touchstick                                 |
| **Set Dynamic Camera Touchstick**  | Sets the sensitivity needed for Camera Touchsticks                 |
| **Hide Dynamic Camera Touchstick** | Hides the Dynamic Camera Touchstick                                |
| **Set Follow Camera Touchstick**   | Adds the Follow Camera Touchstick with orbit speed parameter       |
| **Hide Follow Camera Touchstick**  | Hides the Follow Camera Touchstick                                 |
| **Set Steering Wheel**             | Adds the Steering Wheel Touchstick with orbit speed parameter      |
| **Set Pedals**                     | Adds the Pedals Touchstick for use with Steering Wheel             |
| **Hide Steering Wheel**            | Hides/Shows the Steering Wheel                                     |
| **Hide Pedals**                    | Hides/Shows the Pedals                                             |
| **Set Auto Run**                   | Auto runs the Player either forward of sideways                    |

To use the TouchStick Actions, you require the included Prefabs, as these include script components needed. The following Prefabs must be placed in the Touchstick slot within the GC Preferences Panel, other Prefabs are added to the Action.

* TouchStick Dynamic - for player control, appears under the touch point.
* TouchStick Gyro - used when the Player Movement is controlled by the Gyroscope.
* TouchStick Static - Player movement and fixed position touchstick.

![](https://1680659799-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LauqCzuMnmk33t__Yp5%2F-MQpe7bJAxzTtM8y8csl%2F-MQpeFABMrM3yIdp4uEw%2FScreenshot%202021-01-12%20091408.png?alt=media\&token=a68ba4f3-ee67-4e7a-a2e7-4e14132ff383)

{% hint style="info" %}
It is also suggested that you select **Touchstick Mode : Discreet** in the Preferences Panel. Otherwise the Player character will slide upon movement and the Animations will not Match.
{% endhint %}

1. The **Static TouchStick** needs to be added to the GC Preferences Panel, and the Set Static TouchStick Action called on start. This Action allows you to set the position and offset the position, as well as resize the Touchstick area. A single Tap on the Touchstick can also execute an Action list if set.

![](https://1680659799-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LauqCzuMnmk33t__Yp5%2F-MQq3SG8PPTbMnybOd6c%2F-MQq3veNHJBCw6l3RXvi%2FScreenshot%202021-01-12%20111041.png?alt=media\&token=a360b112-cb2d-414c-a6de-bd88dc6dd11e)

2\. The **Static Camera TouchStick** allows for your game to have **Dual Touchsticks** and not use the drag camera on the screen. The Prefab is added to the Action and NOT the GC Preferences. The other parameters are set up the same. However, it is advisable to also set the Camera sensitivity (Adventure or First Person) to the maximum of 100 as the drag area is reduced to the touchstick and it will be unresponsive otherwise.&#x20;

![](https://1680659799-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LauqCzuMnmk33t__Yp5%2F-MQq3SG8PPTbMnybOd6c%2F-MQq53jmbH-h8JTo2Wxv%2FScreenshot%202021-01-12%20111544.png?alt=media\&token=b8017df0-9faf-4ec9-aba9-acf2df346e20)

3\. The Dynamic TouchStick and Dynamic Camera are configured in the same way. These Touchsticks will appear under the touch point on the left or right respectively, however they do not include a single Tap Action.

![](https://1680659799-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LauqCzuMnmk33t__Yp5%2F-MQq56MskEOEeVnxDX3b%2F-MQq67YkyscK1Nu4s8L_%2FScreenshot%202021-01-12%20112021.png?alt=media\&token=a9d7b78e-9d86-4eca-beaa-55d4cf800e4b)

4\. The **Follow Camera Touchstick** is designed to be used with the follow Camera Motor. It would usually be used in conjunction with a Static Touchstick, but can be used with Dynamic or even Gyro. The Follow Camera Touchstick Action will position the touchstick and set the Orbit speed of the Follow Camera around the Player. This touchstick does not allow for a single Tap Action.

![](https://1680659799-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LauqCzuMnmk33t__Yp5%2F-MQq6Cd5wncwjN2EeJLE%2F-MQq8eBTT0UbJqBBV2dc%2FScreenshot%202021-01-12%20113122.png?alt=media\&token=2148ac1e-30a2-4687-be79-028fa7eb802f)

5\. The **Steering Wheel and Pedals Touchsticks** are design to be used together. They would normally be used for controlling a Vehicle using xAxis and yAxis (see [Extras](../extras) for code examples). The Set Actions for the Steering Wheel also allow for the Wheel angle and the return speed to be set, as well as the size and position.

![](https://1680659799-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LauqCzuMnmk33t__Yp5%2F-MQq9afUmWELFdZk8rNG%2F-MQqDFpi7PeQFW-R5NGo%2FScreenshot%202021-01-12%20114927.png?alt=media\&token=b18322ea-e171-4a50-a043-b88efebc4c21)

{% hint style="warning" %}
When using the Hide Actions for each of the above Touchstick, the Show should be used to show the Touchstick. If you execute the Setup Action again, yopu will may two instances of the Prefab.
{% endhint %}

![](https://1680659799-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LauqCzuMnmk33t__Yp5%2F-MQq9afUmWELFdZk8rNG%2F-MQqE6K0LjePppiQhR7m%2FScreenshot%202021-01-12%20115511.png?alt=media\&token=2bd70a4b-941b-4c72-960d-bbd1e56f166d)

For more information on TouchStick Actions, see [Example 4 - Controls](../examples/example-4-controls), and for details on the use of the Steering Wheel and Pedal Touchsticks, see [Example 5 - Steering Wheel](../examples/example-5-steering-wheel).

6\. The **Set Auto Run** Action is used in conjunction with the TouchStick None. The Player will run either forward or sideways as long as this is activated. To stop the player, simply call the Action again and uncheck Activate. To walk the player or adjust the speed, see the Player Character setup.

![](https://1680659799-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LauqCzuMnmk33t__Yp5%2F-MR-EB0UXogsUW0cYaB2%2F-MR-F7NwwKBkL6RE1Wmm%2FScreenshot%202021-01-14%20103546.png?alt=media\&token=7609598a-73d6-41f1-9f4e-65fa2ca6c71c)

For more information on AutoRun, see [Example 9 - AutoRun.](../examples/example-9-autorun)
