I have the 3rd person controller in my game, which moves with the WASD keys. But since I am developing for a mobile release, I want touch controls.
I have already the touch control-script in a new script-file, but attached to the same 3rd person controller-prefab.
When I swipe right for instance, I want Unity to trigger the D-key etc.
How can I do that?
...
if (Mathf.Abs(delta.x) > Mathf.Abs(delta.y))
{
if (delta.x > 0)
//trigger D?
else if (delta.x < 0)
//trigger A?
}
...