I'm trying to create a virtual joystick using DragHandler, how do I make it functional? Because the X and Y directions are not correct, whenever the Vector moves diagonally, it follows my code:
virtual joystick
Code (CSharp):
- using UnityEngine;
- using System.Collections;
- using UnityEngine.EventSystems; // Required when using event data
- {
- public float vy;
- public float hx;
- public float velocidade=0.0f;