Author Topic: UICamera.currentTouchID not returning right or middle mouse clicks  (Read 2061 times)

Dizzley

  • Newbie
  • *
  • Thank You
  • -Given: 0
  • -Receive: 0
  • Posts: 1
    • View Profile
Like the title says

  1.             if (UICamera.currentTouchID == -2)
  2.             {
  3.                 Debug.Log("rightclicked");
  4.  
  5.             }
  6.             if (UICamera.currentTouchID == -1)
  7.             {
  8.                 Debug.Log("leftclicked");
  9.             }

is not doing anything but 'leftclicked' when called from OnClick() in the inspector while clicking on a sprite which is setup properly

ArenMook

  • Administrator
  • Hero Member
  • *****
  • Thank You
  • -Given: 337
  • -Receive: 1171
  • Posts: 22,128
  • Toronto, Canada
    • View Profile
Re: UICamera.currentTouchID not returning right or middle mouse clicks
« Reply #1 on: November 14, 2016, 06:25:53 AM »
Tried a simple test: new scene, ALT+SHIFT+S, ALT+SHIFT+C, attached this script:
  1. using UnityEngine;
  2.  
  3. public class Test : MonoBehaviour
  4. {
  5.         void OnClick ()
  6.         {
  7.                 Debug.Log("Touch ID: " + UICamera.currentTouchID);
  8.         }
  9. }
  10.  
Hit play, left click, right click, middle click. See

Touch ID: -1
Touch ID: -2
Touch ID: -3