1

have been sitting at this problem the whole day, and I need some help from you guys.

Basically in my have multiple sprites which need to have Event Triggers. I know they are easy to implement and I have played around with applying Event Triggers to buttons, but I have recognized several bugs that appeared, so I cannot work with buttons.

The idea is when sprite is pressed longer (pressed on hold) I would like to lamp to work in my, but when it is released it would turn off.

So far I have added Collider, Rigidbody and Event Trigger to my sprite, but nothing seems to be working. I cannot even Debug a message from the method. If I do the same thing with UI Button not the Sprite, then everything works finem, but in my case I need Sprite to work.

Any ideas on how to fix my problem?

AndroidFreak
  • 866
  • 1
  • 10
  • 31
  • 1
    The type of collier to use must end with 2D since this is 2D. See #7 from the duplicate for how to do actually do the click detection with OnPointerDown and OnPointerUp – Programmer Aug 13 '18 at 19:36
  • 1
    @Programmer Workoed my way through your answer and got it to work, thank you very much. :) – AndroidFreak Aug 14 '18 at 00:02

0 Answers0