Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

How To Disable Editor Snapping - ruins Z coord?

Discussion in 'Editor & General Support' started by Dmitry-Pyalov, Jan 15, 2015.

  1. Dmitry-Pyalov

    Dmitry-Pyalov

    Joined:
    Dec 13, 2011
    Posts:
    125
    Is there a way to disable position snapping in Scene View.
    Right now unity snaps all coordinates to 0.1, 0.01, 0.001 depending on the scene zoom.
    And what is awful - it snaps Z coordinate even if I don't drag Z-axis at all. So it ruins all my manually set Z-coords.

    I have all the snapping options disabled, and I'm not holding any of the Ctrl or V keys.

    Is there a way to make Unity not spoil my Z-coord when I'm not touching it?
     
    Marco-Sperling and Chemaxmax like this.
  2. Aurore

    Aurore

    Director of Real-Time Learning Unity Technologies

    Joined:
    Aug 1, 2012
    Posts:
    3,106
    Go to Edit > Snap Settings

    Are they all set to 1?

    Screen Shot 2015-01-15 at 13.13.42.png
     
  3. Dmitry-Pyalov

    Dmitry-Pyalov

    Joined:
    Dec 13, 2011
    Posts:
    125
    Yes, they all are set to 1. And I'm not holding Ctrl key for snapping.

    I've noticed that snapping values depend on camera zoom - if you zoom in Scene View, this "snapping value" changes from 0.1 to 0.01, 0.001 and so on.

    I could live with that, but the problem is, that snapping applies to Z coord even if I use only XY-axis gizmo. This could not be a problem for a 3D game, but I'm working on 2D, where Z axis has a special meaning (like render layer). I set Z coord manually and it gets very annoying, when it resets after I move an object in XY plane.
     
  4. shopguy

    shopguy

    Joined:
    Jan 12, 2013
    Posts:
    282
    I'm seeing something that I think is related... but I think it's new behavior or maybe a bug. The snap settings shouldn't matter, as long as you aren't holding down control (Windows), but I even tried setting them all to 0.0001 but doesn't help.

    When I move an object using the move tool (the one with the red + yellow arrow, 2D view), it snaps one of the cords to the nearest whole number -- even if I'm not moving in that direction. It only happens with transforms that are nested a few levels (child of child of child, and deeper).

    Or maybe some other setting of my just got toggled? Whatever it is, it is very annoying, and I don't ever remember seeing it in my 2 years of working with Unity. As it stands I have to type all my cords in manually, to lay out my scene.
     
  5. Dmitry-Pyalov

    Dmitry-Pyalov

    Joined:
    Dec 13, 2011
    Posts:
    125
    Yes, this behavior was introduced relatively recently. And it depends on scene zoom. The more you zoom in, the smaller snapping is.

    But the real problem is that it modifies the coordinates even if you don't drag the respective handle.
     
  6. Chemaxmax

    Chemaxmax

    Joined:
    Jan 27, 2014
    Posts:
    204
    I've the same problem. Now it's a pain to make a 2D scenery :(
     
  7. shopguy

    shopguy

    Joined:
    Jan 12, 2013
    Posts:
    282
    Sounds like we should file a bug report... I might do it later, a little burned out and upset with Unity right now though, because I'm trying to create custom 2D character controller... and if you have ever done that, you'll know what I mean (lack of decent collision detection, casting, overlap checking, etc).
     
  8. Foulcloud

    Foulcloud

    Joined:
    Mar 23, 2014
    Posts:
    16
    Same problem with positioning meshes. When zoomed out, the editor loses accuracy. Positions are rounded up, even when not moving that axis. Same problem when snapping to vertex as well. Using version 4.6.6.2f.

    Extremely frustrating and adding so much time to my project. I am going back and zooming in to each piece and realigning to it's neighbor. Any time I want to rejig the level a bit I have to go back over every piece again.
     
  9. Marco-Sperling

    Marco-Sperling

    Joined:
    Mar 5, 2012
    Posts:
    620
    Noticed the same problem here. It keeps snapping Z in 1 unit steps.
    This bug came out of nowhere - everything was working fine before.

    5.1.3p1

    Editor restart didn't help. Neither did changing snap settings to smaller values than 1. X and Y are fine. Z is broken.

    After second restart I deleted the prefab that was acting strange from the scene and dragged a new instance from the project folder into the scene.
    That helped to get rid of the weird behaviour - for now.
     
    Last edited: Sep 30, 2015
  10. Jasior0000

    Jasior0000

    Joined:
    Jan 26, 2014
    Posts:
    1
    Ok so I have just bumped into this issue as well. Similar behaviour (snaps only child objects and only in 1 direction). What I have noticed though, is that the PARENT OBJECT'S scale was set to -1 on X axis, which caused all children's X coordinates to be snapped to nearest integer. Just make sure your parent object scale is not -1 and you should be good. Hope that helps :) John
     
  11. shopguy

    shopguy

    Joined:
    Jan 12, 2013
    Posts:
    282
    Noticed that also, but wish they would just fix this, because sometimes using -1 is the best way to flip a 2D object, and kind of a pain to flip it, make your changes, then flip it back.. I mean, the point of a visual editor is to be able to do things visually, otherwise we'd just do everything in code :)
     
  12. Aurore

    Aurore

    Director of Real-Time Learning Unity Technologies

    Joined:
    Aug 1, 2012
    Posts:
    3,106
    We can't fix a problem without a bug report.

    If you have reported it, please post the number here so we can have a look.
     
  13. Marco-Sperling

    Marco-Sperling

    Joined:
    Mar 5, 2012
    Posts:
    620
  14. Aurore

    Aurore

    Director of Real-Time Learning Unity Technologies

    Joined:
    Aug 1, 2012
    Posts:
    3,106
    Thanks! I can track this in our bug system now.
     
  15. CiroContns

    CiroContns

    Unity Legend

    Joined:
    Jan 28, 2008
    Posts:
    74
    I was having this same problem some time ago. After some digging, I found out it happened because the object I was dragging was child of a parent which had negative scale.
    The object was being dragged in whole increments only on the (surprise!) axis which was negative. The other axes worked fine.

    So the lesson is: do not use negative scale :)
     
  16. Zelek

    Zelek

    Joined:
    Jun 12, 2010
    Posts:
    87
    In retrospect this is obvious, but you can also run into this problem if the Game Object you're moving is a child of a Grid component.
     
  17. bertyhell

    bertyhell

    Joined:
    Dec 23, 2020
    Posts:
    1
    My issue was this button being enabled:
    upload_2020-12-28_20-35-49.png
     
  18. BlazeTyphoon08

    BlazeTyphoon08

    Joined:
    Oct 4, 2021
    Posts:
    1
    Thanks that really helped