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

How to make 2D platformer with Z movement?

Discussion in '2D' started by pastaluego, Mar 20, 2020.

  1. pastaluego

    pastaluego

    Joined:
    Mar 30, 2017
    Posts:
    193
    With capabilities of moving in the Z direction as seen here in Rayman Legends


    Since this isn't possible with 2D, I assume I need to use Rigidbody3D, MeshCollider, and Physics.Raycast rather than the 2D versions. I fully understand how collisions work in general for both physx/box2D and custom character controllers using raycasts, but my main question is how would the colliders for the terrain be generated?

    If I wanted polygonal shaped terrain, how would I make it into a meshcollider specifically for faux 2D collision? My guess is I would make a polygonal mesh tool that creates a mesh along a line in the editor, and then I would extrude the points of the line into the Z and create a chain of quads along that line for the meshcollider to grab from?

    It's hard for me to wrap my head around because I'm so used to the ease of edgecollider2D and polygoncollider2D which you can customize into any shape you want regardless of the renderer, so I wasn't expecting the only option in 3D to be a meshcollider which requires an exact shape mesh as well with no ability to customize the shape of the collider without shaping the mesh first.
     
  2. andy30929

    andy30929

    Joined:
    Feb 26, 2018
    Posts:
    17
    For the topic question like asking how to go 3d to 4d, it is inpossible, 2d only have X and y in vector.

    Also in unity collision, 2d collision is independent to 3d collision.
    Not sure, am i answer to what you ask, i am still beginner :D
     
  3. pastaluego

    pastaluego

    Joined:
    Mar 30, 2017
    Posts:
    193
    Yeah I'm aware they don't interact with each other which is why I said it's not possible with 2D, but I figured I'd ask in this section anyway since Ori and the Blind Forest and Rayman are both virtually 2D because they strictly use 2D sprites (with a few exceptions in Rayman and only the water is 3D in Ori), and for the most part are considered '2D' even though they're technically 3D which would technically make them 2.5D, but they don't quite fit 2.5D.

    But I just don't know how they constructed their 3D terrain colliders on their 2D terrain meshes.
     
  4. andy30929

    andy30929

    Joined:
    Feb 26, 2018
    Posts:
    17
    To make 2d more real, people make a 3d model and capture many slides photo in into the animantion. Só you see a fake 3d in 2d.
     
  5. pastaluego

    pastaluego

    Joined:
    Mar 30, 2017
    Posts:
    193
    Yes I'm aware Ori took 3D models in the first game and rendered them out into 2D sprite sheets (they use real 3D models in the sequel), but again that's not at all what I'm asking about. They're still using the 3D physics engine with 3D colliders and 3D rigidbody and 3D raycasts. What I don't understand is what method they used to construct their 3D terrain colliders from their 2D meshes. My only guess is they had a custom polygonal shape tool that they traced around their un-decorated test environment, and then extruded that mesh data to make a meshcollider of triangles in the X+Z directions along the circumference of the 2D shape.