Unity Developers why remove OnGui?

Hello all,

There is probably a better forum place to ask this question but i don’t know where that would be.

As the title states I am wondering why the unity Developers saw it as a whise move to remove the old OnGui system and replace it for their as they call it: “You should use Unity’s up-to-date UI system instead”

I get that they like to change things and improve their engine and I get that they want to make it more accessible to make an UI. The idea is that you should be able to manage everything from inside the editor and don’t need to use code to create an UI, and since artists are the once mostly focused on creating the UI this way they should be able to make it from the editor right?

This is true basically anyone can start making an ui right now instead of needing to be able to code to make an ui. But its restricting to use the editor ui.
And trying to make the buttons from the new ui fully by code is an absolute nightmare.

void OnGUI()
    {
        if (GUI.Button(new Rect(10, 10, 150, 100), "I am a button"))
        {
            print("You clicked the button!");
        }
    }

HOW SIMPLE CAN IT BE?
ofcourse this is the easiest version of a button but still just try and do the same with creating a button with the new ui, here are a few things you have to do:
create 2 gameobjects (one for the button and one for the text)

add a recttransform for both

define anchor points for the recttransform

set the size (and no not using the normal transform.position and transform.size etc. but the recttransform versions which are just weird after being used to using gameobject.transform

set the parent canvas
add component image
add component button

and many many more things just to create a normal button, seriously why unity developers?
OnGui was so easy to use so simple so why did you have to force the new UI system on us?
Why did you have to remove the OnGui system? why not just leave it running next to the UI system?

edit(moved from answer)

You might be wondering what prompted this question…

I have been working with both system on many different projects, but right now because of hardware i need to use 2019 so OnGui is no more in this version.

In the project that I’m working on everything needs to be scaled correctly with the screen on both axis does this work properly right now with the UI system? NO.
Would this have been an easy fix using OnGui? YES.
What does this mean for my project? I need to make every UI part with code to be able to change sizes fonts and everything else by code!
So a system focused on working solely from the editor is terrible to mimic using code, its just plain awful compared to writing the same with OnGui. I have been spending a long time first setting it all up in the Hierarchy first of all its way to much to wanting to have it all in hierarchy but sure its meant to be build in the Editor so I comply. I finish it turns out I cant make it work with what I need

  • It takes up way to much resources to have it all in the Hierarchy
  • It is a nightmare to change the ui elements from code while its in the Hierachy

So right now I’m recreating the Whole ui by code and im looking at this hot mess and just wheep thinking how much more streamlined and optimized OnGui would have looked in comparison!

There are several things not clear here.

  • First of all the latest stable Unity version at the moment is something around 2018.3. Any 2019 release are beta releases which shouldn’t be used in any production yet. If you have no idea what a beta version is good for, have a look at beta version.
  • I just installed the 2019.2.0a6 version and the IMGUI is still present, can be used and doesn’t generate any warnings or errors.

So I don’t quite get the point of the question. I don’t know which version you used which may not include the IMGUI system. I also haven’t heard about any plans to remove the IMGUI system from the runtime. I agree that this would be a bad move, at least they should make it an optional module in order to keep the engine small for those who don’t need it.

Switching Unity versions during production is generally a bad idea. Let alone switching to a beta release. Switching to a patch release of your currently used version would be ok. Though if you are in the middle of a project you shouldn’t upgrade Unity. That’s why some people still use Unity 5.x.

The name was changed to immediate mode GUI (IMGUI) several versions ago

I am assuming that it is still available as it is listed in the 2019.1b Manual under UI, or am I mistaken?