Search Unity

2D Scene Setup Axes

Discussion in '2D' started by imgodot, Dec 1, 2013.

  1. imgodot

    imgodot

    Joined:
    Nov 29, 2013
    Posts:
    212
    Hello,

    First off, I'm a noob at Unity. I've played around with 3D stuff and some networking in Unity, but I am really a rank beginner.
    That being said, I hope someone can answer these questions.

    For a 2D, top-down game what is the best way to configure "things", for example:

    1) For the playing field (it will look like a map with land and water areas) should I keep the standard X/Z (?) orientation or rotate it so it is in the X/Y plane? The X/Y plane makes more sense to me, but a new Unity scene seems to assume the former.

    My players will be ships that need to collide with the land areas on the playing field (map); they must stay in the "water" parts, therefore:
    2a) Should the playing field be a sprite?
    2b) A texture applied to a plane?
    2c) A background texture with individual sprites for the land areas?
    2d) Something else?

    3) How should collisions on the, relatively, slow-moving ships be handled? Rigidbodies? Other?

    Each player can create multiple "ships" in the game.
    4) Because these "ship" objects will be created dynamically, how do you assign a script to a dynamically created object?

    Thanks for any help.
     
  2. unitylover

    unitylover

    Joined:
    Jul 6, 2013
    Posts:
    346
    Stick with XY because in 2D there is no Z. Affecting the Z plane causes weird results in a 2D environment.

    Stick to sprites. You can break up the map if it's going to be huge in to different chunks of areas if needed.

    A simple box collider will suffice just fine. Unless you need physics on your ships you do not need a rigidbody.

    Use the AddComponent method of the GameObject class. More info here.

    I hope this helps.
    Mike
     
  3. imgodot

    imgodot

    Joined:
    Nov 29, 2013
    Posts:
    212
    UnityLover,

    Thanks very much for the information.
    Very helpful.

    -- Paul
     
  4. enjay

    enjay

    Joined:
    Nov 27, 2013
    Posts:
    14
    @unitylover, thank you. This was helpful to me as well!