-
Notifications
You must be signed in to change notification settings - Fork 34
Open
Description
I used this code found in the Unity Script Reference to get a basic drag and translate. The code is placed in the Update method.
I know touchCount works. But touch phase???
if (Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase.Moved)
{
Vector2 touchDeltaPosition = Input.GetTouch(0).deltaPosition;
transform.Translate(-touchDeltaPosition.x * speed, -touchDeltaPosition.y * speed, 0);
}
Here is the link to the unity reference
http://unity3d.com/support/documentation/ScriptReference/Input.GetTouch.html
Stan
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels