Search Unity

Do I have to rescale all my objects?

Discussion in 'Physics' started by OlivierPons, Dec 7, 2014.

  1. OlivierPons

    OlivierPons

    Joined:
    Sep 20, 2014
    Posts:
    28
    Hi,

    Here's my story so far: I tried to make a full game Web-based (HTML5 and so on). I'm pretty good at doing Websites (it's my job), but after months of struggling with tons of un-finished libraries (no library is properly finished actually), I gave up and tried Unity.
    So I have a full Web-server made for turn-by-turn games (not what the kind of what Unity provides).

    So I've made a 2D interface to look like what I did for the Web: 3 scenes:
    - "splash screen" scene
    - "main menu" scene (to choose to create or join a game)
    - "game" scene (the game itself)

    I think I've done it the wrong way, but now here's what I want to do: have everything in only one big scene, with all previous "scenes" moved into empty objects, and make those objects appear using built-in gravity.

    So far I've moved "SplashScreen" and "MainMenu" together like this: "MainMenu" is over "SplashScreen" (seen attached files 1 and 2).

    The problem is that when I try to add a sphere, just to test, the sphere is incredibly small, and so I have a big problem of scale: see attached file 3. Do I have to re-scale everything? And the problem is that the camera is configured like attached file 4: I need to have it "fixed" so that I can easily build my game for all the 3 platforms I want (PC, Android, iOS).

    How do you handle this problem?
     

    Attached Files:

  2. JamesLeeNZ

    JamesLeeNZ

    Joined:
    Nov 15, 2011
    Posts:
    5,616
    why dont you change the scale of your sphere?
     
  3. StarManta

    StarManta

    Joined:
    Oct 23, 2006
    Posts:
    8,775
    One thing about Unity 4.6 is that the Canvas and the rest of the scene are very different things. The canvas is rendered directly onto the screen and its units in the world are raw pixels. The rest of the world is rendered by any Camera objects you have and their sizes are unrelated to pixels (although not technically assigned to a particular size, it's easiest to assume that 1 unit = 1 meter, as some of the defaults like gravity are designed with that assumption).

    In general, if you have anything as a child of the Canvas that does not use a RectTransform (see the top of the Inspector), then you're mixing the two systems and are going to have troublesome results. In fact, I don't believe that the Canvas will even render your sphere there at all, even if you do scale it up to a reasonable size - only a Camera will render it. No 3D objects in the Canvas, it's not made for them. 3D objects should be placed in the "real world" which is rendered by the camera.

    Likewise, the camera will not render any of your UI elements, so these two worlds can harmlessly "overlap" in terms of their positions.
     
  4. Nanako

    Nanako

    Joined:
    Sep 24, 2014
    Posts:
    1,047
    just a personal opinion. everything should be designed around a proper scale to begin with, working under the assunmption that 1 unit is 1 metre.

    if i were you i'd bite the bullet and just go rescale everything. it sounds like you messed up the first time around, and you don't want to continue building ontop of a bad foundation.

    also remember that scale shown in the UI is not actual size, it's onmly a relative scale. you need to use scripts or an editor extension to see the actual unit size of objects.