Search Unity

Question Scaling issues with marker based game

Discussion in 'Unity MARS' started by macgregger, Jun 10, 2022.

  1. macgregger

    macgregger

    Joined:
    Feb 13, 2018
    Posts:
    28
    Hello Marsians,

    I want to place an interactive 2D Game on top a poster on my wall. So far I managed to set up the MARS Szene with the image marker and placed the game background and the player. When I build it it all works fine.



    My first problem is the scale. My game objects are all child objects of the image marker and thus become too tiny for me to generate a unity navmesh onto the background for example.

    I can't change the scale of the marker, since the image has a fixed size. Any suggestions?

    Thanks a bunch.
     
  2. jmunozarUTech

    jmunozarUTech

    Unity Technologies

    Joined:
    Jun 1, 2020
    Posts:
    297
  3. macgregger

    macgregger

    Joined:
    Feb 13, 2018
    Posts:
    28
    Thank you very much. This fixed the issue. I noticed this setting bevor but was not sure how to use it. Now I know ;)
     
    jmunozarUTech likes this.
  4. jmunozarUTech

    jmunozarUTech

    Unity Technologies

    Joined:
    Jun 1, 2020
    Posts:
    297
    glad it worked out! happy MARSing!
     
  5. macgregger

    macgregger

    Joined:
    Feb 13, 2018
    Posts:
    28
    Ok, maybe I was a little bit too quick to declare this a success. ;) Unfortunatly there are still some issues.

    My image marker is a poster with a physical size of 50cm x 70cm. I believe I have set this up correctly. (see image below)



    My game-content is inside an empty game object called AC Game, with a scale of 1,1,1.



    The sprites inside the AC Game Object are scaled in relation to the parent. The scale of the background image is also 1,1,1, so it covers the physical poster exactly. I then upped the scale to 60 in order to have a big enough scale to generate a navmesh for my player to walk upon. A scale of 1 resulted in a very small Image Marker in the scene view.



    Now I have two problems.

    When I press play the simulation and the device view scale down to miniscule size. And the content is not displayed. Can anybody help me?

     
  6. jmunozarUTech

    jmunozarUTech

    Unity Technologies

    Joined:
    Jun 1, 2020
    Posts:
    297
    Hello @macgregger,

    Its totally fine if your simulation appears far away, just keep right click pressed and move with ASDW around the simulation environment to get closer

    there are a couple of things you might want to try. First of all, make sure your Near clipping plane on your main camera is small enough (0.01); you might be clipping content from the near plane without knowing.

    Screen Shot 2022-06-15 at 9.51.56 AM.png

    Secondly, you will have to scale your content depending on your scale, For example, with a scale of 1 on the MARS session and a proxy with an image marker of 50cms that has a cube of size of 0.5x0.5x0.5m you will get a cube that occludes the whole image as you can see here:
    Screen Shot 2022-06-15 at 10.00.46 AM.png

    The same cube with a scale of 2 it will be half the size as you can see here:
    Screen Shot 2022-06-15 at 10.01.43 AM.png
    And a scale of 0.5 will make the content twice the size as you can also see here:
    Screen Shot 2022-06-15 at 10.02.40 AM.png

    So in order to make everything work you will have to play (in this case) with the cube scale to make it mach your image size so the pathfinding can work since scales are so small on a physical poster size.

    Hope this helps you out, let us know how it goes :)