- Home /
Use Unity UI For 2D Games Or Custom Objects Instead?
I loved the new UI for 3D games.
However I have started my first 2D game, and I am at a cross road. Is it worth using the Unity GUI for a 2D game or would I be better off just making all the sprites myself and rendering it directly in the game world instead of worrying about the canvas and such?
Since its a 2D game, I don't need to worry about the UI being rendered by a special camera fixed on a Canvas object. My game camera isnt moving so a button in the world space is the same as a button in the canvas space.
If you are a 2D wizard and have used the new Unity GUI or made your own UI instead I'd love to hear if you think using the Unity GUI is better for fixed camera 2D games.
Answer by moghes · May 08, 2015 at 11:35 AM
Just like zeppike mentioned, a memory card game is fine to do with new UI.
When you create a canvas, look at the size of the Canvas how its huge which means whenver you have to apply physics rules to your game you will get strange results (remember UI is for UI).
For example test how slowly a rigidbody falls or collision react, you need to have strange values when using AddForce ..etc so the answer is NO if you have any physics applied to your game.
Any puzzle,grid, memory,card games or quiz games are fine and sometimes better to do it with the new UI.
So think of your game if its more like a UI or an actual game and take your desicsions upon.
Hope it helps.
I think Ill try using a fixed space UI for the game overlay, and give objects in the game a canvas of their own for interaction options.
You can also have multiple canvas-es. For example if you have a memory-game, you can separate them into 2 canvases.For UI like Healthbar, menu-s ..etc I found the scale mode to be "Scale with Screen Size".
If the answer answered your question, please don't forget to accept as a correct answer.
Answer by zeppike · May 08, 2015 at 08:15 AM
I have already done a game with the new UI. It was a memory game with cards. For me the layout system helped a lot, but on some point I wished I have done it on the in the gameword. It is quite a mess when you want to position object on top of each other. It is also quite hard to work with canvas positions. All together I would recomend the UI system, for very basic games. It is quite a pain when you try to achive more than planned with preset layouts for example. For a side scroller, or shooter, or basically anithing more complex than solitery I would still use the gamespace.
Your answer
Follow this Question
Related Questions
[VR] How to display a canvas with Oculus 5 Answers
Good way to scale 3D GameObjects in a Canvas (Screen Space - Camera)? 1 Answer
Custom Dropdown Sorting Order problem 2 Answers
Unity 4.6 adding a Canvas Text onto a gameobject prefab?? -1 Answers
UI with no Ztest appearing behind geometry when masked. 1 Answer