Search Unity

  1. Click here to receive a gift with your purchase of Unity Pro or Unity Enterprise.
    Dismiss Notice
  2. Good news ✨ We have more Unite Now videos available for you to watch on-demand! Come check them out and ask our experts any questions!
    Dismiss Notice

Feedback [ProGrids] Configure separate snap increment values for each axis

Discussion in 'World Building' started by Xarbrough, Jul 7, 2019.

  1. Xarbrough

    Xarbrough

    Joined:
    Dec 11, 2014
    Posts:
    824
    I've used ProGrids in several projects with good success to snap modular asset kits or place 3D prefab tiles on a square grid. However, with my newest project I found an opportunity for ProGrids to also support arbitrary grid types such as hex grids.

    Currently it is not really possible to snap to a hex grid, but it would probably be relatively easy to let users configure the snap increment value for each axis separately, which would then allow snapping to any type of grid, including hex tile grids.

    For example, I would like to configure the snap increment for the x-axis to 0.9 and for the z-axis to 1.57, this would solve many placement issues even for special use-cases like snapping to non-square shaped modular kits.

    This feature would probably be best disabled by default, but a configurable setting in the user preferences.
     
  2. gabrielw_unity

    gabrielw_unity

    Unity Technologies

    Joined:
    Feb 19, 2018
    Posts:
    745
    Hi! We're working on a native Grids package for Unity, should land in 19.3, and it already has this functionality! :)
     
    Xarbrough likes this.
  3. Zyblade

    Zyblade

    Joined:
    Jul 1, 2014
    Posts:
    129
    Sorry for necro post, it wouldn't make any sense to make a new one, just to link to this one.
    I still can't find non uniform, axis independent snapping in progrids. Are there any plans to add that feature, or do I still have to overwrite the package and add it myself(which I, btw., need to do on every update...)?

    Or maybe, I just missing a GUI checkbox and the feature is already added. But I couldn't find one.
     
  4. ThomasLopez

    ThomasLopez

    Unity Technologies

    Joined:
    Jun 8, 2020
    Posts:
    23
    Hi Zyblade,
    you can now trigger snapping directly in the editor (ProGrid is not needed anymore).
    You can find the snapping option right next to the local/global button in the toolbar. The snapping will only be available in global manipulation.
    Here is a short demo in 2019.4 :
    snapping20194.gif
     
    Zyblade likes this.
  5. Zyblade

    Zyblade

    Joined:
    Jul 1, 2014
    Posts:
    129
    @ThomasLopez Thanks a bunch. The grid works good. But I can't use it, because I need more float precision for my custom pixel grid. My own script adds up to 8 digits after comma. Unitys grid seems to add only 2-3 digits. I have a very special use case, where foat precision is very important. Maybe you guys can add a custom setting for this or increase the precision in general?

    edit:
    to explain my use case, I snap my objects to a virtual pixel grid:

    x/32 = x axis (x = 1)
    y/32 = y axis (y = cosecant (csc) from camera rotation X)
    z/32 = z axis (z = secant (sec) from camera rotation X)

    I'm working in 3d space, so I use my own values instead unity's pixelperfect asset.
    So moving my meshes on that custom grid requires calculating those grid numbers more precise

    Oh, and it doesn't work with probuilder. I can't move my vertices on that grid. ProGrids snapping works with probuilder. I already added 2 additional axes to ProGrids snapping behavior. But I need to do that on every update. It's not a really big deal. Would be just a nice addition to use it with full precision and probuilder support, without the need to modify it on my own =) For now, it would be enough, to just have the precision.
     
    Last edited: Aug 9, 2020
unityunity