0
\$\begingroup\$

There are a lot of scripts involved so I'm just going to give a generalized description of the process.

First, a 1x1 square tile is created. Second, that tile is placed out of the way, and 16 x 10 (160) new tiles are created starting at the (0,0) position and building outward in positive numbers. Now, the camera is a 16:10 display. At this point, I wanted to scale up the tiles. If I want to scale the map up I start by scaling the camera by 100, and then I scale the tiles, and align their position (edge to edge). At this point, scaling the tiles by 100 seems logical, but that didn't work correctly, for some reason. Scaling by 50 almost works, but the resolution is no longer a 16:10 grid like it was before the scaling.

What am I doing wrong? I am using Unity.

\$\endgroup\$
  • 4
    \$\begingroup\$ "There are a lot of scripts involved so I'm just going to give a generalized description of the process." This is usually a good sign that you should try to simplify the situation by creating a "minimal, complete, verifiable example" — this will help you get high-quality answers quickly, by minimizing ambiguity and back-and-forth discussion. To do this, start a new project and try to reproduce the core issue in the simplest way you can (ideally one script). Take anything out of that script that doesn't affect the problem, then share that code. This keeps the focus on the core of the issue. \$\endgroup\$ – DMGregory Feb 6 '17 at 15:34
  • 1
    \$\begingroup\$ "but that didn't work correctly for some reason". Ok now try putting yourself in our position and think how we can help you with such a precise description of what is not working... \$\endgroup\$ – realUser404 Feb 6 '17 at 15:42
  • \$\begingroup\$ ""but that didn't work correctly for some reason". Ok now try putting yourself in our position and think how we can help you with such a precise description of what is not working..." Well that's easy, the scale is wrong. If you had read one line further you would know that x50 scale was closer to matching the camera size. Its not that there is any identifiable error, no scripts are touching the scale at all to begin with it's public variables in the Unity Editor: I thought maybe my problem was with my preconcieved notion of math behind scaling because nothing else seems to make sense. \$\endgroup\$ – Jones Crimson Feb 6 '17 at 15:53
  • \$\begingroup\$ It appears you presumed your scaling was wrong. In actual fact, this was not the issue, as you report a restart fixing your problem. In effort to reclarify the usage of scale, I am removing the scale tag from your question. I would potentially restructure this question to "my latest change is not applying". If I came to this question looking for help fixing my resolution, I would find it very unuseful. \$\endgroup\$ – Gnemlock Feb 7 '17 at 0:16
-2
\$\begingroup\$

First, I counted the tiles left to right to find it was only 15:9. Then, I checked the script to see if it was instantiating these tiles correctly: and it was.

Finally I restarted the Unity Editor and MonoDev, which fixed the issue. I believe the last correction I had made to the script was just not being properly applied.

\$\endgroup\$
  • 1
    \$\begingroup\$ Undo the change, restart & see if the problem returns. If it does, then you know whether or not the last change corrected the problem. \$\endgroup\$ – Pikalek Feb 6 '17 at 17:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.