So I just started to work with Unity, I am good at everything like : graphics design(UI), 3d modeling, and so on, but I am new to programming and don’t really know much yet. How can I move the player with touch on x axis like if I was dragign the player with my finger? I only found this piece of code on forums, how can I use it, is it even the correct one? And can some one please tell me were could I find some easy, fast step-by-step unity(C#) Coding/undestanding tutorials. Thanks!
var speed : float = 0.1;
function Update () {
if (Input.touchCount > 0
Input.GetTouch(0).phase == TouchPhase.Moved) {
var touchDeltaPosition:Vector2 = Input.GetTouch(0).deltaPosition;
transform.Translate (-touchDeltaPosition.x * speed,
-touchDeltaPosition.y * speed, 0);
}
}