• 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 Yurijh · May 11, 2017 at 02:15 PM · editorpositioninglevel-design

How to make objects stick together in the editor

I have two tiles of street and I need to position them consecutively, without spaces. If I work manually I cannot obtain a perfect positioning. The picture can display the problem alt text

I've already tried to change the snap settings but without useful results. Someone suggests me to work with vertexes (pressing V and moving the object) but I have not a magnetic behaviour as I wish to.

tiles-problem.jpg (21.8 kB)
Comment
Add comment · Show 2
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 _dns_ · May 11, 2017 at 02:59 PM 0
Share

Hi, i developed some custom object snapping with "OnDrawGizmosSelected()". It's a little hacky but works. i.e. get transform.position and snap it to integer values or whatever grid based constraints. It should be possible to find objects that are nearby and use their transform.position too. Warning: do not assume that awake() or start() were called on any objects when OnDrawGizmosSelected() is called.

If this does not work, I'd suggest using an EditorWindow but that may involve a little more code.

avatar image Yurijh _dns_ · May 11, 2017 at 03:21 PM 0
Share

I found some assets perfectly working with snaps. Thank you anyway!

2 Replies

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

Answer by leech54 · May 11, 2017 at 03:10 PM

Get your mouse near a vertex and hold down the v key on the keyboard and it will snap to the closest vertex. try it on a corner or the plane for best results.

Comment
Add comment · Show 2 · 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 Yurijh · May 11, 2017 at 03:20 PM 0
Share

I've already tried that, as you can read in my question...

avatar image leech54 Yurijh · May 11, 2017 at 04:05 PM 0
Share

If you are using v and snapping the corners together the line you are seeing is possibly in the Texture itself.

avatar image
0

Answer by Yurijh · May 17, 2017 at 07:35 AM

Yes, you're right, that's the solution! I tried to use 'v' but i was not moving the vertex but the arrows around it. While pressing v and dragging the vertex, it will stick to the closest one, like a magnet.

Comment
Add comment · Show 2 · 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 EdwinChua · May 17, 2017 at 08:04 AM 0
Share

@yuyorke maybe you should accept @leech54 's answer and upvote it ins$$anonymous$$d of what you did here?

avatar image Yurijh EdwinChua · May 17, 2017 at 08:10 AM 0
Share

yes, you're right, I just thought this could be more precise.

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

7 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Prevent selection of sub-object 1 Answer

Objects in-editor that copy their components instead of stretching 0 Answers

Questions about using the tilemap. 1 Answer

Issue with sprite / animation postion on preview normal on edit mode 1 Answer

Placing items on terrain in the editor 3 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