Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
0
Question by Arkinum · Mar 14, 2015 at 01:11 AM · vertexsnapping

Problems with vertex snapping, 2D peoject Unity 5

I thought I posted this yesterday, but I can't seem to find it (yes I looked for my post via my profile). So sorry if this becomes a double post. Anyway~

I jumped back into Unity after a somewhat long hiatus in the world of Blender, and decided to re-import a project that I was working on in Unity 4.x, piece by piece into Unity 5 (I need the practice anyway).

I'm using a sprite sheet 1536 X 1536 and I sliced it into 512 X 512 tiles. I haven't changed the scale of the tiles, they are all default 1,1,1. I am using the v key to vertex snap the tiles.

The tiles vertex snap as you would expect when I do single tiles, but if I bulk duplicate and snap, it leaves about a pixel wide gap at the 15th or so tile. I only noticed it on the X axis but haven't tried to duplicate the problem on the Y axis.

Another problem I'm having is I have tiles that lay on top of some other tiles. I have already set the layer value so they stay "on top" of the other tiles. I noticed that when I snap them into place I start to run into slight offset problems.

Usually when you vertex snap you have to move the mouse to the somewhat extreme to get it to snap to the next vertex. What is happening though is when I snap the tiles on top of other tiles it causes the mouse to become a bit sensitive in that area and starts offsetting my tiles by about 0.02 in either the X or Y axis. I noticed the square on the gizmo also blurs and sharpens when this happens.

I don't remember running into these issues in the earlier release of Unity.

So, is this some kind of feature I have to disable/tweak? If so, how would I go about changing it? Or is this a bug I should report?

Thanks

EDIT:

I removed the previous post I had on this problem, the mods finally approved it after 20+ hours so I thought it was MIA. I'll keep this one instead.

Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Arkinum · Mar 14, 2015 at 09:45 PM 0
Share

I tried to get around the above problem by just setting the snap setting to 5.12 X 5.12 Y (size of my tiles) and I'm getting the same issue on the 15th tile.

I think the problem can be reproduced if you have all the tiles in the same spot then snap them across one direction.

For some reason it looks like Unity is rounding the float numbers at some points creating 0.01 space gaps between tiles.

1 Reply

· Add your reply
  • Sort: 
avatar image
1
Best Answer

Answer by Sebastian_Miko · Apr 01, 2015 at 04:41 PM

Scroll down to TLDR Solution if you just want a solution and rather not read.

I had the same issue, although it didn’t wait for 15 sprites to show spacing. The issue was random for me, sometimes spacing showed, and sometimes it didn’t. But it was guaranteed to show at some point for EVERY vertex snap. For me, this is unacceptable in game.

I spend several hours troubleshooting, trying all types of different scenarios Texture Atlases (Sprite Sheets) and Single Sprite Mode - sprite on an individual Texture.

From my troubleshooting my findings were

The issue OCCURS when:

  1. You use a sprite from a Sprite Sheet / Texture Atlas, and that Sprite does not take up the entire width or length (depending on where you actually want to snap to) of the Sprite Sheet / Texture Atlas

The issue does NOT OCCUR when:

  1. You use a sprite that takes up the entire width or length (depending on where you actually want to snap to) of the Sprite Sheet / Texture Atlas it is on

  2. You use a sprite that has its own Texture (Single Sprite Mode).

Conclusion It seems to me that Multiple Sprite Mode is flawed in terms of vertex snapping, unless your sprite actually takes up the width and length of that sprite sheet.

TLDR Solution

  1. Use individual Textures for your Sprites

    (Unity 5.0 automatically creates one Sprite Atlas when building the game, so creating Sprite Atlases are no longer necessary for performance reasons). I realize it may be necessary for other reasons.

  2. If you must use Sprite Sheets -

    a. Have the sprite take up the entire width or length of the Sprite Sheet depending on which axis you’re snapping to

    b. Scripting - above my pay grade

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image Arkinum · Apr 02, 2015 at 03:14 PM 0
Share

Thanks for the response and tips Sebastian. I never tried to slice my images in Gimp/Paint so they made up a single tile, but I may try that later.

I forgot to post this, but I think the distance of the camera plays a part in the gap process.(or at least for me it dose)

I found kind of a workaround myself about a couple of days after this post. I noticed that if I leave my camera at a fairly close distance to the tile and snap, the sprites don't get gaps and they align properly.

So I snapped all my "ground" sprites in blocks of four and parented them to one of the blocks, then snapped the parent. the problem is still there, but I got around it by limiting the amount of snapping and keeping the camera zoomed in. Still a pain when I do bulk snapping...

I'm glad I'm not the only one having this problem. Hopefully the Unity $$anonymous$$m notices and fixes it in the next update.

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Vertex snapping while resizing 1 Answer

How to Vertex-Snap the corner of a Sprite-Shape 3 Answers

Vertex snapping of any mesh at runtime 2 Answers

Procedural Vertex Snapping 1 Answer

Snapping UI sprite? 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges