• 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
Question by cj31387 · May 29, 2015 at 07:37 AM · editorsnap

Editor Snap to floor?

Is there a hotkey like unreal to snap a gameobject in the scene to something below it like unreals end key? I know this somewhat partially exists because when you drag a prefab from the asset folder out into the viewport and continue to hold the mouse button down it will snap to what ever you are mousing over. But is there a key to do this when a object is already in the editor hierarchy?

I want it to work like it does when you drag a new asset out like this (but for existing assets in the editor). The vertex snapping is kind of too complex especially when its a high vertex model.

https://dl.dropboxusercontent.com/u/94084288/ShareX/2015/05/2015-05-29_00-47-54.mp4

Comment

People who like this

0 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 Gruffy · Apr 16, 2018 at 02:54 PM 0
Share

Personally, with the advent of Pro tools like "Pro Grids", Unity's snapping reminds me of a famous Back to the future II quote :

Roads? Where we're going, we don't need roads.

Unity snapping has always been there, but grab Pro Grids and see the difference altogether, Unity bought it so we could use it for free and because it was better than anything currently available in the engine for object placement and snapping.

(Pro Grids ftw honestly) :)

2 Replies

  • Sort: 
avatar image
Best Answer

Answer by blueriver123 · Oct 27, 2017 at 06:05 AM

try unity manual

Surface snapping

While dragging in the center using the Move tool, hold Shift and Control (Command on Mac) to quickly snap the GameObject to the intersection of any Collider.

Comment
sanmn19
MigMig
tfunk
CoughE
KirschiX
BootySmashDeluxe
SimRuJ
ArturDenislamov
cj31387
Hardfaile

People who like this

10 Show 4 · 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 sanmn19 · Apr 16, 2018 at 02:43 PM 2
Share

This should be the answer.

avatar image tfunk · Oct 12, 2018 at 03:08 PM 2
Share

This took me a second to sort out, but it works great! While holding shift+ctrl, you have to use the square in the center of the Move tool (which you said). I was initially trying to use the arrows of the move tool, which does not work.

TL;DR Be sure to use the center of the move tool, not the arrows.

avatar image BootySmashDeluxe · Feb 14, 2021 at 08:19 PM 0
Share

I made a whole game and then realized this was a thing. Nice to know!

avatar image ArturDenislamov · Mar 05, 2021 at 10:56 AM 0
Share

thank you very much, that's must have

avatar image

Answer by ninjapretzel · May 29, 2015 at 07:40 AM

There is 'vertex snapping' on the v-key when using the Translate or Rect tools.

Select the object you want to move.

Press V

Hover over the vertex you want to snap

Click and drag it to the vertex you want to move it to

Unity will move the object so the two vertices are touching.

(Edit: Who thought it was a good idea to have lines that are together merge?)

Comment
cj31387
jimm84
sanmn19
APProjects
Temosh

People who like this

3 Show 4 · 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 cj31387 · May 29, 2015 at 07:44 AM 0
Share

Is there also a key for doing it based off pivot or something, It can be kind of hard when its a high vertex mesh to get the bottom of something

avatar image ninjapretzel · May 29, 2015 at 08:13 AM 1
Share

I don't know, but when you drag a prefab from the project window onto a solid, it does place the object at the origin. The only thing is you can't do the same when the object already exists in the scene.

It's also possible to script something that makes the object move onto the ground- put the content of this pastebin in a script in a folder named "Editor". http://pastebin.com/2vrUVf5E

It will add a menu option in the top menu that you can use to move an object's pivot into the ground. If Unity doesn't provide a solution for something, it's pretty easy to extend the editor and add the feature with a little script like that.

avatar image burtonposey ninjapretzel · May 02, 2016 at 10:17 PM 0
Share

Thanks for posting this! I improved this a tad to be more like Unreal.

Shortcut is now Shift+END and the script now looks in the select object for a MeshRenderer (first one it finds as written) and it checks the renderer's bound.extents and compares the resulting position from the center to the extent with the selected objects y position. This ensures that if a transform has a pivot at the bottom of the object, the script doesn't blindly assume a center pivot.

http://pastebin.com/QGTCqD6T

avatar image DiegoDePalacio burtonposey · Nov 10, 2017 at 01:20 AM 0
Share

Thank you for your help!

The last version of the script can be improved in order to also be able to snap objects in where the pivot point is outside of the mesh renderer boundaries, by replacing the foreach loop with the next code snippet:

     foreach ( Transform t in Selection.transforms )
     {
         MeshRenderer renderer = t.GetComponentInChildren<MeshRenderer>();
         if ( renderer != null )
         {
             RaycastHit rayhit;
             if ( Physics.Raycast( renderer.bounds.center, Vector3.down, out rayhit ) )
             {
                 float offsetY = rayhit.point.y - renderer.bounds.min.y;
                 t.position += new Vector3( 0f, offsetY, 0f );
             }
         }
     }

Unity Answers is in Read-Only mode

Unity Answers content will be migrated to a new Community platform and we are aiming to launch a public beta by June 9. Please note, Unity Answers is now in read-only so we can prepare for the final data migration.

For more information and updates, please read our full announcement thread in the Unity Forum.

Follow this Question

Answers Answers and Comments

30 People are following this question.

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

Related Questions

Editor Script - Access the User's Snap Settings? 1 Answer

Wheres the snap to pixel option in the shader/material editor? 1 Answer

Child Object is Snapping 0 Answers

How does ray snapping in the editor work? -1 Answers

Editor Handles Vertex Snap not working on script's object. 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