Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

2D platform on 3D world

Discussion in '2D' started by verdekiwi, Oct 27, 2020.

  1. verdekiwi

    verdekiwi

    Joined:
    Oct 12, 2020
    Posts:
    5
    Hi guys. New here

    I’d like to work on a 2D platoform game, but to add more depth and make it more interesting, I’d like to have it on a 3D world.

    all the actions should happen on a “flat panel”, so as a standard 2D game, player can only go left, right and jump,

    buuuuuut

    the background and the level design shloud be 3D.


    Like passing in front of a house you can see is a 3D object, not 2D


    What’s the best way to approach that?
    Working on a 2D platform and add 3D element, or set up a 3D platformer where the camera (and the player) can only move 1 derection?


    extra note: the reason why I don’t want to just animate and house to give a 3D effect, is that I dream that past the house the world “turn”.game is different plan, but still 2D


    Thanks!!
     
  2. MrPaparoz

    MrPaparoz

    Joined:
    Apr 14, 2018
    Posts:
    157
    So when you're working with sprites, you put them in a Sorting Order for rendering which is not required in 3D Space because objects can be in front of each other physically.
    If player won't interact with 3D objects it should be quite straight forward. 2D colliders won't work with 3D colliders. So you might want to create 2D colliders for 3D objects.
     
  3. VishwasGagrani

    VishwasGagrani

    Joined:
    May 12, 2018
    Posts:
    84
    Change camera to perspective instead of orthographic. That will add depth to the scene.

    Also if you are using a 3d object like box better to use edge-collider component to adjust it as per the shape. Because 2d box collider may not work if you change the rotation values of the box.
    You can also use 3d collider but not recommended as would be more expensive for 2d game.
     
    Last edited: Oct 27, 2020