Skip to content

TouchPhase not working??? #53

@stanleyjoy

Description

@stanleyjoy

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions