Search Unity

  1. If you have experience with import & exporting custom (.unitypackage) packages, please help complete a survey (open until May 15, 2024).
    Dismiss Notice
  2. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice

OnMouseDown not work in Vuforia

Discussion in 'AR/VR (XR) Discussion' started by Emi11, Sep 6, 2019.

  1. Emi11

    Emi11

    Joined:
    Sep 6, 2019
    Posts:
    1
    I have a problem with Unity3D. I'm working on an AR project with Vuforia+Unity and I was testing the OnDownMouse() event so that when I play the GameObject and do an action, in this case just Debug.Log() to try.
    But this only works the first time, and the second time I give play to try it doesn't work.
    I've been looking at the colliders and they're well configured.
    Another thing I noticed is that the script check disappears what I suspect may be the problem.
    upload_2019-9-6_12-8-33.png

    Code (CSharp):
    1. using System.Collections;
    2. using System.Collections.Generic;
    3. using UnityEngine;
    4.  
    5. public class Click : MonoBehaviour
    6. {
    7.     void OnMouseDown()
    8.     {
    9.         Debug.Log("Hace CLICK!!!");
    10.     }
    11. }
    12.  
     
  2. datagreed

    datagreed

    Joined:
    Sep 17, 2018
    Posts:
    45
    Did you solve it and how?