Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Unity UI [SOLVED] Pointer down event on image is being triggered multiple times

Discussion in 'UGUI & TextMesh Pro' started by jzzja, Nov 10, 2018.

  1. jzzja

    jzzja

    Joined:
    Sep 28, 2017
    Posts:
    43
    I have a seemingly simple problem but I can't find how to fix it. I have a UI image which has a pointer down event on. When clicked it sets a bool to true which then makes my player jump. Even though I click once on the image button the function is triggered multiple times. I also have a pointer up event which sets the bool to false.

    Any advice appreciated, I can post my code if required. Thanks!
     
  2. jzzja

    jzzja

    Joined:
    Sep 28, 2017
    Posts:
    43
    I've sorted this now, it was simple, I just added another bool to check the state of the button.