Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

touchphase not working ??

Discussion in 'Scripting' started by Vindatra14, Nov 18, 2015.

  1. Vindatra14

    Vindatra14

    Joined:
    May 8, 2015
    Posts:
    87
    Code (CSharp):
    1. void Update (){
    2.         foreach (Touch touch in Input.touches) {
    3.             if (touch.phase == TouchPhase.Ended) {
    4.                 Debug.Log ("count");
    5.             }
    6.         }
    7.     }
    Excuse me, I want to ask about touchphase, why this script can't work ?? I don't know what's wrong here, any help will be apreciate
     
  2. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    8,744
    One of the most meaningless phrases seen on this forum is "not working". That tells us nothing. What are you expecting it to do? In what conditions have you tried it? How does the actual behavior differ from the expected?
     
    Kiwasi likes this.
  3. Vindatra14

    Vindatra14

    Joined:
    May 8, 2015
    Posts:
    87
    my touchphase.ended there not working, I debug it but when I try to run it, that function not work to debug and check that my tap leave it
     
  4. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    8,744
    OK, so you have gone into play mode, and tapped and released your tap, and did not see a debug message. (Just to be sure: I mean tapped and released with your finger, using the Unity Remote. Input.touches does not work with the mouse.)
     
  5. Vindatra14

    Vindatra14

    Joined:
    May 8, 2015
    Posts:
    87
    ooh touch doesn't work with mouse, so I must check it at real device for touch then, Bcoz as I know mouseDown can do at by tap at andro but mouseUp can't detect that the finger release from device. That's I get from the inet, am I right ??
     
  6. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    8,744
    MouseUp should also work with finger up.
     
  7. Vindatra14

    Vindatra14

    Joined:
    May 8, 2015
    Posts:
    87
    ooh thanks for correction, then i'm not surf deep enough about mouseUp and touchphase.Ended. Thanks again :D