I have a bunch of skills and 3 buttons which represent the enemies’ faces… When I click one of the skills (which are also buttons), I activate a couple of highlighters depending on the available targets… For example, you cannot cast the fire skill on the ‘Fire Guy’, therefore only 2 out of 3 highlighters activate.
The problem is that I have a function that is being called when I click the button, but I think that it is not detected because of the highlighter that stands in the ‘priority’ way.
note: the highlighter is semi-transparent, but I don’t think that matters…
LE: One question is: is the priority thing the problem or did I write the function in a wrong way?
So it sounds like you click the fire button, it activate a canvas object that has it’s transparency set to 50%. you are trying to then click on the transparent object to hit an object behind it. then yes the the transparent object is absorbing the raycast.
you could change the layer to on the transparent object to “ignore raycast”
I’m not sure the question exactly.
But, to clarify. You have skills. You click one and it highlights the enemies you can attack and greys out the ones you can’t? If the highlights are images, you can just turn off their raycast so they aren’t in the way. The greyed out image could have raycast so you don’t attack that target. (or, you just make the button not interactable, which would also make it not clickable).
As far as is your function wrong, you didn’t show code, so I can’t say. And really, I don’t know your scene setup, so I’m guessing as to what is wrong.
@johne5 posted ahead on one solution. If it’s an image, you can just uncheck Raycast Target.
It’s a panel, but it will probably work. Thanks!
It worked just as expected. Thank you!