Search Unity

Onmousedown Vs Event Trigger

Discussion in 'Scripting' started by BZLC, Apr 14, 2019.

  1. BZLC

    BZLC

    Joined:
    Jan 6, 2018
    Posts:
    4
    Hi All,

    I can get the same result for mouse click with 2 ways below (e.g. Debug.Log message)

    1. Sprite + BoxCollider2D + OnMouseDown
    2. Sprite + BoxCollider2D + Physics2DRaycaster + EventTrigger (PointerClick) + EventSystem
    I just wonder what is the difference between two? Is there any advantage of one over another? Thanks
     
  2. prof_pooding

    prof_pooding

    Joined:
    Mar 1, 2016
    Posts:
    2
    Hey, did you find this out in the meantime? I came across the same dilemma.