Scaling issues with marker based game

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.

Hello @macgregger

For the scaling issue I would suggest you to set the world scale in the mars session gameobject in MARS Working with MARS | MARS | 1.0.1.

Hopefully this will sort out these type of issues :slight_smile:

hope it helps!

Thank you very much. This fixed the issue. I noticed this setting bevor but was not sure how to use it. Now I know :wink:

1 Like

glad it worked out! happy MARSing!

Ok, maybe I was a little bit too quick to declare this a success. :wink: 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?

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.

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:

The same cube with a scale of 2 it will be half the size as you can see here:


And a scale of 0.5 will make the content twice the size as you can also see here:

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 :slight_smile: