Unity 3D C# – Creating UI elements from scripting

According to the manual, you can’t add UI elements directly from code, you need a Prefab. But there is a workaround for this scenario. You create a standard GameObject, add a RectTransform and that’s it. It converts itself to an UI element:



Did you like this? Share it:

So, what do you think ?