Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.

2D Games

Discussion in 'Editor & General Support' started by ivanmoen, Dec 27, 2008.

  1. ivanmoen

    ivanmoen

    Joined:
    Dec 26, 2008
    Posts:
    102
    I’m new to Unity and was wondering if it is possible to use Unity to create 2D games? With this I don’t mean 3D games viewed from the side, but 2D (flat) games with images not 3D objects.
     
  2. HiggyB

    HiggyB

    Unity Product Evangelist

    Joined:
    Dec 8, 2006
    Posts:
    6,183
    Yes, that's possible, but know Unity isn't optimized for that sort of development process. We have the UnityGUI system which allows you (primarily) to create in-game user interfaces (buttons, text, images, and so on), if you wanted you could use that and create an entirely 2D based game.
     
  3. ivanmoen

    ivanmoen

    Joined:
    Dec 26, 2008
    Posts:
    102
  4. HiggyB

    HiggyB

    Unity Product Evangelist

    Joined:
    Dec 8, 2006
    Posts:
    6,183
    Yes, that's definitely a Unity game. The trick is whether or not they happened to do everything via UnityGUI or not. The other way to go about making 2D games is to use flat planes in a 3D world, apply images as textures on those planes, then use an orthographic camera to get a nice, clean and flat 2D look.
     
  5. jeffcraighead

    jeffcraighead

    Joined:
    Nov 15, 2006
    Posts:
    740
    I just finished a 2D game for the iPhone http://www.youtube.com/watch?v=io6KtPDEWVY and it went pretty smoothly. I haven't used any 2D engines before so I don't know what I'm missing in terms of 2D specific collision and animation features, but if you're comfortable with 3D engines producing a 2D or 2.5D game isn't too difficult.
     
  6. 1stAnd10

    1stAnd10

    Joined:
    Jan 9, 2008
    Posts:
    79
    I am currently developing a proof of concept of my game idea in 2D using XNA and once Unity comes to Windows I plan on porting it over to 3D inside of Unity.

    I'm mainly using 2D right now to get something up fast, flesh out my ideas and get the state machine diagrams correct which will work for moving a 3D player around or a 2D player.
     
  7. ivanmoen

    ivanmoen

    Joined:
    Dec 26, 2008
    Posts:
    102
    Is Unity coming to windows???
     
  8. Tempest

    Tempest

    Joined:
    Dec 10, 2008
    Posts:
    1,286
    Eventually, yes. They're working on it.
     
  9. HiggyB

    HiggyB

    Unity Product Evangelist

    Joined:
    Dec 8, 2006
    Posts:
    6,183
    @iam69: yes, it's coming in Unity 2.5 which is not more than a couple of months away.


    In the future, please note that basic forum etiquette says that you should (a) use the search function before posting questions as this has been asked/answered many many times already, and (b) you should not bury your question here in another thread on totally different topic.
     
  10. ivanmoen

    ivanmoen

    Joined:
    Dec 26, 2008
    Posts:
    102
  11. Mr. Animator

    Mr. Animator

    Joined:
    Oct 2, 2005
    Posts:
    193
    I was just looking at that tumbledrop game, and it certainly looks like they're using polygon planes with textures applied to them, as that would be the easiest way to apply physics to them as they have.

    One thing I'm curious about is how they're animating the faces on each block. I assume its some kind of animated texture - any ideas on how you'd go about that? I've been considering taking a stab at a 2d game built on textured planes and wasn't sure how I could swap what texture was being displayed on the same object without constantly swapping materials.
     
  12. HiggyB

    HiggyB

    Unity Product Evangelist

    Joined:
    Dec 8, 2006
    Posts:
    6,183
    Don't swap materials, just either:

    (a) repeatedly swap out the one material's main texture

    (b) use a "long" texture (16 x 128 for example, really a long series of 16x16 textures) and then repeatedly adjust the texture offset to show only the 16x16 block of interest

    Both of the above prevent you from having to constantly swap materials, but you do need to think about what materials are on what objects so various entities can be animated separately.
     
  13. Barbur

    Barbur

    Joined:
    Oct 30, 2009
    Posts:
    160
    I am planning to do a 2D game for wiiware and I still dont know what to do: use 3D planes with textures or use the GUI system. What would you recommend me? The first problem I can think about the 3D planes is the resolution changes will affect to the planes sizes....
     
  14. Tempest

    Tempest

    Joined:
    Dec 10, 2008
    Posts:
    1,286
    I recommend you look into SpriteUI and GUIManager (search for them, they each have their own dedicated topics).

    SpriteUI 2 was actually just released a week or so ago. These are plugins for Unity which allows excellent control and manipulation. For example, Waddlefield.com, that iPhone game uses GUIManager exclusively for all it's sprite input, movement, etc.
     
  15. Barbur

    Barbur

    Joined:
    Oct 30, 2009
    Posts:
    160
    Hey I have been having a look to SpriteUI and seems nice but it seems it is specific for iphone.
     
  16. Dreamora

    Dreamora

    Joined:
    Apr 5, 2008
    Posts:
    26,601
    SpriteUI - SpriteManager 1 are actually generic and work independent of the platform as they optimize the stuff on mesh level.

    SpriteManager 2.0 works on any platform too but the automatic batching only exists on Unity iPhone
     
  17. Barbur

    Barbur

    Joined:
    Oct 30, 2009
    Posts:
    160
    But I downloaded the SpriteUI from the topic http://forum.unity3d.com/viewtopic.php?t=22371
    that is supposed to be the last version and when I try to execute the example I get iphone related errors because the class SpriteUI has specific calls for iphone :eek: Any idea what should I do?
     
  18. Hakimo

    Hakimo

    Joined:
    Apr 29, 2010
    Posts:
    316
    I just noticed this thread and saw the tumble drop trailer. I'm so curious on how did they make the GUI animation tweening effect. Does anyone know how to make animated GUIs like in the trailer?
    -Hakimo
     
  19. Hakimo

    Hakimo

    Joined:
    Apr 29, 2010
    Posts:
    316
    Nevermind thanks, just found out about iTween ;)
    -Hakimo
     
unityunity