void Update () {
if (!createLineupPanel.activeSelf) return;
if (Input.GetMouseButtonUp(0))
{
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
Debug.Log(1);
if (Physics.Raycast(ray, out hit))
{
Debug.Log(2);
}
}
}
The console only logged 1 but no 2 when I was clicking.
I used this function before and it worked but I don't know why it doesn't work this time. Is there any additional things that I need to post?
--- Update ---
Panel is under Hierarchy -> Create -> UI -> Panel