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.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice
  3. Join us on November 16th, 2023, between 1 pm and 9 pm CET for Ask the Experts Online on Discord and on Unity Discussions.
    Dismiss Notice

Using Unity's 2d mode over 3d for a platformer

Discussion in 'Editor & General Support' started by IE-online-Entertainment, Nov 9, 2014.

  1. IE-online-Entertainment

    IE-online-Entertainment

    Joined:
    Feb 3, 2014
    Posts:
    28
    Im creating a 2d platformer and I was just curious about a few things. Ive noticed when using the built in 2d editor in Unity, the camera looses things like depth of field and 3d spacing. What is the benefit of using this 2d mode over creating a 2d side scrolling platformer in the normal 3d mode?

    To be a bit clearer, I want my backgrounds to keep their depth of field depending on the rang they are from the camera. I also want to maintain the ability to work in a 3d space. Will this be possible with the 2d mode on?
     
  2. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    The 2D mode only affects the scene view. You can set your game camera to be perspective rather than orthographic if you want. You can also continue to work with sprites and such with 2D mode turned off in the scene view.

    --Eric
     
  3. IE-online-Entertainment

    IE-online-Entertainment

    Joined:
    Feb 3, 2014
    Posts:
    28
    So I can pretty much just ignore the 2d option?
     
  4. N1warhead

    N1warhead

    Joined:
    Mar 12, 2014
    Posts:
    3,884
    You could always switch to 3D mode and switch to Orthographic, less stuff you gotta deal with than 2D. As you can use the concepts of 98% of tutorials out there and still keep the 2.5D Depth as well. That's what it sounds like you're trying to do. Have the depth of the ground/platforms/backgrounds. Granted 3d Art is hard, but so is 2D. but if you're good at Pixel art than you can just as easily make a 2d sprite look as good as a 3d Model if you use a lot of pixels (obviously).

    So that way you can still have a 2D/2.5 platformer with more ease in the scene view, then when you feel like you're ready try and see if an orthographic or prospective camera view is more suitable for what you are trying to do.


    But again, I LOVE 2D games, however, I couldn't begin to understand how to make one, which is why I always say just try to do 2.5D as it still uses 3d Assets to make it, but that is only my opinion, I'm in no way trying to lead you from one thing or another, just throwing some insight that (I understand) which could be totally wrong... ERIC if I am wrong please don't get mad at me, just trying to help, I know I'm not the smartest one in the bunch at times LOL.
     
  5. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    If you want. It's really just a shortcut for setting the scene view camera to "back" with perspective off, though if you have 2D mode on you can also drag sprites from the project view into the scene view and they will automatically become sprite GameObjects.

    --Eric
     
  6. IE-online-Entertainment

    IE-online-Entertainment

    Joined:
    Feb 3, 2014
    Posts:
    28
    I think you are pretty much on the same page as me. I am using strictly 2d sprites, though. Even for the backgrounds. Im just wondering if I use the 3d camera, will you be able to see the sides of any of my sprites once the camera moves? Maybe that doesn't make sense.
     
  7. IE-online-Entertainment

    IE-online-Entertainment

    Joined:
    Feb 3, 2014
    Posts:
    28
    That sounds very handy. In fact the what ive been learning incorporates that. Thanks for the replies.
     
  8. N1warhead

    N1warhead

    Joined:
    Mar 12, 2014
    Posts:
    3,884
    Possibly could. One way around it is make the Camera attached to your player, so where ever your player is, it will be following him directly where you put it... It kind of stinks doing it that way though because if you jump, well the Camera jumps with you exactly without a damping motion...

    However, I am very sure you could easily script the Camera to only move along one axis (Perfectly) without doing the other unless told to do so.

    However, the only other problem you'll have is seeing the sides of enemies (possibly) I really don't know though as I have never done 2D.
     
  9. IE-online-Entertainment

    IE-online-Entertainment

    Joined:
    Feb 3, 2014
    Posts:
    28
    Thanks for the input. It is much appreciated. These are all useful things to consider. I guess my main thing is just being able to move background objects further into the background so that they actually look further away. This also ties into a game play mechanic im considering. Come to think of it, I believe Rayman Legends, or Origins did this very thing. Hmmmm
     
  10. Eric5h5

    Eric5h5

    Volunteer Moderator Moderator

    Joined:
    Jul 19, 2006
    Posts:
    32,401
    No...see here, which uses sprites with a perspective camera in order to do parallax scrolling backgrounds easily.

    --Eric
     
  11. IE-online-Entertainment

    IE-online-Entertainment

    Joined:
    Feb 3, 2014
    Posts:
    28
    Cool. I just checked it out. This is what I was talking about. I can tell there is depth in the background and its all locked on their axis's. Thanks.