Search Unity

  1. Unity 2019.1 is now released.
    Dismiss Notice

Feedback Fix viewing direction labels

Discussion in '2D' started by tristanlbailey, Apr 22, 2019.

  1. tristanlbailey

    tristanlbailey

    Joined:
    Jul 14, 2016
    Posts:
    6
    Despite having used used Unity on and off for about 5 years, I am still getting used to using it. Over the years, I have been working on a "2.5D" game (think 3D side-scrolling platformer), which is a remake of an old game in 2D.

    After spending countless hours importing and placing 3D objects into the first scene, and getting the terrain just right, I decided to try using the "2D" viewing mode (for the first time) to help me get all of the proportions / sizes and placement of everything right.

    Unfortunately, upon clicking on the "2D" button, I witnessed Unity's scene viewport spin the view around, so that I was effectively looking at the back of all my game's objects, rather than the front.

    I then wondered what had gone wrong. Was this a bug in Unity, or a very big mistake on my part?

    At first, I jumped back and forth between my usual 3D view from the front, and the 2D view, just to confirm that I wasn't seeing things. While in 3D viewing mode, I looked at the label underneath the "Scene Gizmo" (XYZ interface in the top right corner). It simply said "Front", which made sense at the time. So, why was it when I clicked the 2D view mode button, it showed the back of everything? Why did it not simply flatten the 3D view from the front that I had?

    By clicking on the cube in the centre of the XYZ gizmo, I noticed that I could switch from Perspective to Orthographic projection mode. This allowed me to see the view that I was trying to get to with the 2D button. Although I could do this, I was still confused. Why couldn't I do the exact same thing with the 2D button?

    I came to the conclusion that I had placed everything around the wrong way. I then decided to try moving everything around 180°, so that everything was facing the correct way. I learned that I could do this by creating another game object at the very top of the scene hierarchy, put everything else in the scene onto the object as children of the object, and then rotated them all around the Y axis, by putting 180 into the object's Transform Y axis property.

    Unfortunately, I discovered that while it rotated almost everything around the correct way, it did not affect the rotation of the terrain. I had to move the terrain to the correct location, and then redo all of the terrain painting from scratch. Further, I found that one of my particle effects had to be fixed up, as it was no longer firing in the correct direction.

    So after all of this, I then clicked on the 2D button, and it worked as expected. However, it still left me wondering what the problem was to begin with. Was I that incompetent not to realise from the very beginning what I had done wrong, before spending many hours more working on things?

    I clicked on the 2D button again to get back to the 3D view, and took another look at the label underneath the "gizmo". While facing everything front on, the label now displays the word "Back", which works against the grain of basic logic. If the 2D view mode works fine now, then why should the word "Back" be displayed, when I am viewing everything from the front in the 3D viewing mode?

    Then I thought, "maybe I'm not thinking about this the right way, maybe 'front' and 'back' means something different". So then I decided to consult the Unity manual. Looking at the "Scene view navigation" page in the Unity manual, and seeing the orthographic "Front" view in the "BITGEM" example, I noticed that the red X axis was pointing left in the gizmo, instead of right. Yet, after moving everything around in my project to get the 2D mode to work properly, my project's gizmo had the red X axis pointing to the right, with the word "back" showing.

    The 'Scene view control bar' page doesn't really shed any light on the matter, only confirming that the red X axis points right in 2D view mode. The 'Gameplay in 2D' page doesn't help at all, mentioning only Y and Z axis.

    With confusion outstanding and considerable time lost (though luckily not a huge amount), here I am.

    I wish to request that the viewing direction label be fixed with regards to the "Front" and "Back" views. Specifically, I believe that the "Front" label should be named "Back", and visa-versa, which would remove confusion and save time for those who wish to use the 2D view mode, especially people who are quite new to using Unity. The alternative would be to change the behaviour of the 2D view mode, so that it faces the "Front" [sic]. However, I suspect that the latter would be a far more controversial change than the former, as it would have the potential to upset projects worldwide.

    There may be more that needs to be done, such as making it more obvious to people when they start a new project. There may be other alternatives that I have not thought of, but I will leave these points open to debate. Thanks for taking the time to read this feedback.
     
  2. jeffreyschoch

    jeffreyschoch

    Joined:
    Jan 21, 2015
    Posts:
    2,418
    In Unity, the positive Z axis is "forward".

    So when you're looking in 2D scene view mode, with X right, Y up, and Z forward, you're looking at the "back" of the object, because its positive Z is facing away from the camera.

    In 2D however, you generally use the X axis as the 2D "forward". The Z axis remains pointing forward, so (when oriented along with Unity's 2D mode) you're technically always looking at the "back" of a 2D object and rotating about the Z axis.
     
    Last edited: Apr 22, 2019
  3. tristanlbailey

    tristanlbailey

    Joined:
    Jul 14, 2016
    Posts:
    6
    Thanks for your reply.
    OK, so you have just stated the way Unity behaves. Is there an explanation as to why Unity behaves this way?
     
  4. jeffreyschoch

    jeffreyschoch

    Joined:
    Jan 21, 2015
    Posts:
    2,418
    Well mainly I'm telling you that the labels you're seeing aren't actually wrong, since that is your feedback. They are correct for the way Unity is set up.

    As for why it's set up that way?

    Why does Unreal Engine use X axis as forward? Why do some engines use Y up and some use Z up? It comes down to engineer preference, it's arbitrary. They could swizzle the axes any way they like under the hood, and so can you.

    Nothing is stopping you from making your whole game on the YZ plane and using X as forward, or any other orientation that you prefer. The main reason not to do that is because Unity's tools and functions are built to work in a specific coordinate system (Vector3 uses +x=right, +y=up, +z=forward), so if you want to take advantage of them and write code that integrates seamlessly, it makes sense to align your design with the same orientation they chose for their engine.
     
    Last edited: Apr 24, 2019
  5. tristanlbailey

    tristanlbailey

    Joined:
    Jul 14, 2016
    Posts:
    6
    Correct me if I'm wrong, but now you appear to have justified that the behaviour Unity displays is not wrong, based on... what? That's it's been that way for ages? That I should just accept it as fact and move on?

    Put yourself in my shoes. I came here because I was:
    1. Thoroughly confused
    2. Had wasted considerable time
    3. Sort to resolve the issue by submitting feedback to Unity, to the best of my ability
    The concept of feedback hinges on challenging the norms, questioning "why is it so?", and seeking to provide a better experience not just for ourselves, but for others. This behaviour that I experienced in Unity is something that I found to be out of place, and thus sort to seek an proper explanation for it, at the very least, if not to find a solution to the problem, or request the problem be fixed.

    I understand that other engines may be arbitrary in the way that they orient views, and that Unity can choose its own way to orient views, but what I experienced was counter intuitive. It did not make sense. Sure, I could just continue using Unity as if the problem never happened, but would we be better off for it?

    I could also simply stop using Unity and use some other game development program too, but then why would I do that when I have been happy to use Unity, despite its occasional hiccups?
     
  6. jeffreyschoch

    jeffreyschoch

    Joined:
    Jan 21, 2015
    Posts:
    2,418
    I don't have the time or energy to dive into a philosophical debate about coordinate systems.
    Read this for a better explanation: http://answers.unity.com/answers/38991/view.html

    When you use a 3D program, you should always find out their coordinate system before jumping into development. Every 3D program could be different so try not to make that mistake in the future and you'll save yourself the time and confusion.

    You made an assumption about Unity that turned out to be inaccurate. It happens, and it will probably happen a lot as you keep learning. Hopefully if you switch to a new engine you won't have trouble working with their coordinate system because of this experience.
    Why not? It's such a trivial thing, what are you even hoping to accomplish here? Why spend time arguing about it when you can just accept how it works (because it's not going to change) and continue to make your game?
     
    Last edited: Apr 25, 2019
  7. tristanlbailey

    tristanlbailey

    Joined:
    Jul 14, 2016
    Posts:
    6
    As far as I'm concerned, I did not make an assumption about orientation. I made a judgement based up the information available to me at the time. If anything, I made a mistake by not testing out all of Unity's features earlier. It did not occur to me at the time I started my project that the 2D view may be a useful tool to me.

    You have completely missed the point. If you actually read my first post, you would know that it was not trivial at all, and also understood what I intended to accomplish by posting feedback here.

    Not that I like my chances, but I'll wait for someone else to reply to this thread. Please don't reply to me again, you will be wasting both of our time.
     
    jeffreyschoch likes this.