- Home /
Why does my UIButton needs a raycaster if the parent has one?
I have been struggling with my UIButton in my In-Game menu. After reading a number of posts, such as the one linked below, I ended up adding a RayCaster Component to the UIButton. However, the two parent canvasses (the "UI Panel" containing the button and the main canvas containing the panel) already have a RayCaster component. According to the answer linked below this shoud be sufficient. However, it doesn't work (i.e., button doesn't get highlighted, is not clickable, etc.) for my case, if I do not add a specific RayCaster to the button.
One strange thing is that, although the button doesn't work without the RayCasting, I can let the EventSystem select the button as "First Selected". If I then hit space the onClick event gets fired.
I placed a couple of screenshots below. More screenshots can be found (at the moment of writing) at this Amazon Cloud Link .
I would appreciate if anyone could explain me what is going on.
InGameMenu Canvas:
Restart UIButton:
[2]: +http://answers.unity3d.com/questions/780043/new-ui-buttons-doesnt-work.html