Search Unity

Possible 2D Button Bug...

Discussion in '2D' started by HarryFozza, Nov 16, 2019.

  1. HarryFozza

    HarryFozza

    Joined:
    Oct 18, 2019
    Posts:
    4
    Hi! So basically my mate and I have been making a simple 2D clicker game.

    I recently recorded the entire game in a couple of hours (to simplify and remove all un-needed variables. Everything worked, buttons, auto clicker and all sorts. I accidentally clicked the 2D button underneath Scene, Game, Animator etc. (if you don't understand where I'm talking about it's in the top left.

    It became 3D, I didn't think anything about this then went back to 2D. ALL my buttons have stopped responding like there is something in front of them. I'm super confused and this is really annoying as I spent so long recording this game. I'll attach a video.

    NOTE: There was nothing wrong with this until I changed from 2D by accident.

    Youtube link:
     
  2. eses

    eses

    Joined:
    Feb 26, 2013
    Posts:
    2,637
    Hi @HarryFozza

    This is not a 2D question, but a UI question... So you should ask this in UI area.

    Clicking 2D view mode doesn't do anything - it is just a view mode, just like rotating camera to top view, it surely isn't the reason for your UI not working.

    I don't know what you mean by you "recorded" the game - sounds more like you did refactoring of your code perhaps?

    Anyway, some reasons for uGUI UI not working might be:

    You have transparent, overlapping UI element, that gets the click first.

    Your scene doesn't have UI EventSystem component. Check that your scene has the default game object created by UI system that should have both the EventSystem component, and the Standalone Input Module.

    Also check that your Canvas game object has Graphic Raycaster component attached for raycasting against UI elements.

    See this page for UI components needed for UI system to work:
    https://docs.unity3d.com/Manual/EventSystem.html

    Edit:
    Seems like this is sort of recurring theme, people post UI questions to 2D area - perhaps the thinking is UI = flat = must be a 2D question.
     
    Last edited: Nov 16, 2019
    HarryFozza likes this.
  3. HarryFozza

    HarryFozza

    Joined:
    Oct 18, 2019
    Posts:
    4
    Thank you so much <333, it was the event system (I didn't even realise it was missing xD) my mate deleted it and didnt think it was needed :d, anyway thank you so much