Answer the question
In order to leave comments, you need to log in
The click works immediately on two objects in different layers, how to fix it?
Hello. I'm making a clicker and ran into a problem:
I have a ClickButton object stretched to the full width of the canvas, when clicked, the Click function is triggered, causing the animation. There is also an Emitter above the canvas, which spawns objects from prefabs (animation from Particle System with 2D Collider and Rigidbody) flying over ClickButton, they are controlled by a script that causes a destruction animation when clicking on them. And now it turns out that when you click on a flying object, both functions are triggered, respectively, 2 animations are played. How to make it so that only the destruction animation works?
I also note that there are UI elements above the "ClickButton", when clicking on which the animation does not play, everything is ok.
The layers of ClickButton and flying objects are different, ClickButton is located lower in the hierarchy.
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question