0
\$\begingroup\$

I'm new to Unity and purchased a set of modular building pieces from the asset store. I'm trying to arrange pieces of wall. The pieces are 5 x 5 x 0.5, so I've set my world grid size to 5 units and am using align to grid to make them line up nicely. I'm running into an issue when I try to make a corner. When I align the pieces to the grid, there is some gap and overlap, as seen in this picture:

enter image description here

I then tried to manually move the end piece inwards, which resulted in this:

enter image description here

That looks slightly better, but needed a manual adjustment so I don't think doing this everywhere scales very well, and plus there is some kind of visual/lighting artifact where the pieces overlap (hard to see in the screenshot but very obvious when I move around in game mode). Then I tried resetting that end piece back to the grid and pushing the two side pieces inwards, which resulted in this:

enter image description here

This looks good and has no overlap, but required a bit of manual adjustment and brought the sides off of the grid.

Assuming a set of wall pieces that are 5x5x0.5, how can I configure my grid and snap settings so that everything fits together nicely?

\$\endgroup\$
3
  • 1
    \$\begingroup\$ Typically there is no real good way to get things to snap together well in this type of case if your walls have depth. This is because it hard to join them together at a corner (someone needs to fill the gap) as you saw in your first image. If your walls are 2D planes this is no issue since the lack of depth lets them join perfectly but this has it's own draw backs (pretty sure lighting/shadows are not exactly plane friendly). To get around this, most tile sets include corner pieces and side pieces. You can easily find 2D examples of this by searching for tile sets. \$\endgroup\$ Commented Oct 2, 2020 at 5:21
  • \$\begingroup\$ Thanks! That makes sense, I'll check the set I got for corners/sides. \$\endgroup\$
    – Joe M.
    Commented Oct 2, 2020 at 6:53
  • 1
    \$\begingroup\$ You can as well arrange a few bigger pieces manually, make a prefab out of those (like nice corners, cubes, tunnel segments) so you don't need to rearrange all parts again but can work with bigger pieces at one time. \$\endgroup\$
    – Zibelas
    Commented Oct 2, 2020 at 7:54

1 Answer 1

2
\$\begingroup\$

What you are looking for is Vertex Snapping: you hold V selecting the vertex you want to snap and click and drag on the vertex you want it to snap. See the Snapping Section on this page of Unity documentation for other snapping techniques.

\$\endgroup\$
1
  • \$\begingroup\$ But even if I use vertex snapping for the examples in my post, I think I will still have the issue of overlap or gaps at the corners, right? \$\endgroup\$
    – Joe M.
    Commented Oct 3, 2020 at 17:33

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .