I'm using Unity 3D's new UI system to build a pause menu for my game. Currently I'm trying to have my buttons respond to mouse clicks. Some of my hierarchy is as follows:
When I click on one of my buttons in-game nothing happens, this includes a lack of button animation that should occur when hovering. My "Main Canvas" gameobject contains the following components:
I have already ensured that my Image component has "Raycast target" checked and that my Button component has "Interactable" checked.
Could this be because my Canvas' render mode is in screen space (camera)? I need the render mode to be set to this because I have 3D models that are added in front of the UI during gameplay.
Things I have already tried / checked:
- Ensured that an EventSystem was present
- Checked that another UI element wasn't covering the buttons, preventing a raycast
- Ensured that the camera rendering the UI is above my main camera that is attached to the player. The rendering UI camera has a layer of 1 while the player camera has a layer of 0.