Assign a Touch Button to an Action

Once you have created an action in the axes list, you can assign a touch button to it:

  • Go to the Touch Panel gameObject, inside the Canvas component of the player.

  • Copy and paste any Touch Button inside of the Touch Panel. Also, you can add a new empty object, add a Raw Image component, configure its texture and add a Touch Button Listener. Here's how the button inspector looks:

  • Also, you have to configure the name of that button with the same name that the action which uses it. For example, if the action is called “Jump”, the touch button needs to be called “Jump” too (this is used in the code to identify better every touch button). Finally, assign that object in the Touch Button element of the action configured.

  • When a touch button is added, the option Show Touch Button Scale is shown.

Last updated