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

Camera 2D RPG in perspective

Discussion in '2D' started by PatataFrita, Oct 17, 2014.

  1. PatataFrita

    PatataFrita

    Joined:
    Oct 17, 2014
    Posts:
    50
    Hi,

    I'm trying to make an old style rpg game in 2D. And I have problems with the camera. I know I can use the orthographic camera, but I want to use the perspective camera. The question is, is there any way to simulate the effect of an orthographic camera but still use the perspective camera?

    Maybe using matrix cameras? I do not know what exactly is, but I read something looking information.

    Any help is welcome.
     
  2. Pyrian

    Pyrian

    Joined:
    Mar 27, 2014
    Posts:
    301
    I don't think I understand the problem. You want to perspective camera that acts like an orthographic camera, but isn't one? I think you'll need to break down what you want the camera to do - and not do.
     
  3. PatataFrita

    PatataFrita

    Joined:
    Oct 17, 2014
    Posts:
    50
    In Orthographic does not work point light, only directional light works.

    But if I work on perspective, I do not get the old style RPG effect, so I need to convert a perspective camera into an orthographic camera. To make it look same and also use shadows.

    An example of what I mean:

     
  4. PatataFrita

    PatataFrita

    Joined:
    Oct 17, 2014
    Posts:
    50
    Any idea?
     
  5. Kiori

    Kiori

    Joined:
    Jun 25, 2014
    Posts:
    161
    buy 2d toolkit.
    Skip to around 12 minutes:
     
  6. PatataFrita

    PatataFrita

    Joined:
    Oct 17, 2014
    Posts:
    50
    Last edited: Oct 25, 2014
  7. Kiori

    Kiori

    Joined:
    Jun 25, 2014
    Posts:
    161
    If this works out for you please let me know(msg me).
    you could also try getting in touch with the unity guys, sometimes they implement user needed approaches to their tech.
    I'll give it all a try if I get the time.

    Best of luck

    Edit:


    This is after 5 min. of poking.
    See, if i wanted to do this right now, i'd generate a mesh(with blender or wings3D) with the same shape of the sprite and maybe apply the texture onto it, or something of a sort.
    Either way, its possible with '3d' shapes(meshes). Not sure how it would go about sprites(quads), if you find out let me know, like i said I may look into it later on.

    Btw what you see on the picture is me using a rotated 'plane', so you cant see it, but its there, to generate a light. Not sure if there are ways to generate "planes" of different shapes, hence I suggested a mesh.
    I'm not exactly a unity expert.
     
    Last edited: Oct 26, 2014
  8. Kiori

    Kiori

    Joined:
    Jun 25, 2014
    Posts:
    161
    http://www.third-helix.com/2012/02/05/making-2d-games-with-unity.html

    This blog post also gave me an idea, you could(as shown in the post), make black(shadow) images of whatever, and have them rotate around whatever 'light'(gameObject) you want. virtually creating any effect.
    Btw, in all honestly, in 2d, its better to 'fake' light, as in draw it, like i suggested above, than to use a real light.
    Lighting is more for real 3d and its a great source of slowdowns.
     
  9. PatataFrita

    PatataFrita

    Joined:
    Oct 17, 2014
    Posts:
    50
    Hi, sorry the delay.

    For now works which AlwaysSunny said to me. But you have to be careful because sometimes some graphical complications arising .

    The solution you bring me seems more complicated than which I have done now. But if I had problems, I'll try your solution.

    Thank you very much.