Search Unity

  1. Looking for a job or to hire someone for a project? Check out the re-opened job forums.
    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

[ProBuilder][Feedback] Holding 'v' key should snap vertex to vertex in vertex mode

Discussion in 'World Building' started by mostlyhuman, Feb 20, 2020.

  1. mostlyhuman

    mostlyhuman

    Joined:
    Mar 16, 2013
    Posts:
    53
    Just started using Probuilder today and was very surprised that holding the V key in vertex mode did not snap vertices to other vertices, unless i'm doing something wrong this just seems like the way it should work since unity works this way. I am trying to make a ramp from a cube and am trying to snap the upper vertex of each corner to the lower vertex so they are perfectly aligned. I realize I can probably put down a grid and snap to that but vertex to vertex snapping shoulder be an obvious feature. Thanks in advance for any future consideration.
     
  2. Nananaaa

    Nananaaa

    Joined:
    Jul 24, 2016
    Posts:
    31
    Vertex snapping seems to be broken in 2020.1.0b2 as well as in 2019.3.5f1.
     
  3. kaarrrllll

    kaarrrllll

    Unity Technologies

    Joined:
    Aug 24, 2017
    Posts:
    445
    It's working for me, what version of ProBuilder are you using?
     
  4. Ardinius

    Ardinius

    Joined:
    Oct 4, 2015
    Posts:
    53
    Also having an issue with Unity 2019.4.0f1 and probuilder 4.2.3 with vertex snapping. Note very new to using Probuilder so the fault could be with me, but creating a new shape and holding v fails to snap to any vertexs.
     
  5. kaarrrllll

    kaarrrllll

    Unity Technologies

    Joined:
    Aug 24, 2017
    Posts:
    445
  6. imaethan

    imaethan

    Joined:
    Dec 13, 2012
    Posts:
    2
    I'm having this issue with Probuilder on 2020.2.2f1 and Probuilder 4.4.0. Can't snap vertices and I get some error with the VertextManipluationTool script when I try to do so.

    Tried all the other available versions of probuilder and they all have the same problem.

     
    Last edited: Jan 25, 2021
  7. kaarrrllll

    kaarrrllll

    Unity Technologies

    Joined:
    Aug 24, 2017
    Posts:
    445
    I remember someone modified the function signature for FindNearestVertex recently, it may be that ProBuilder is still using reflection to access an outdated method. Can you file a bug report please? If you'd like PM me the ticket ID and I will look into it.
     
  8. WormyGels

    WormyGels

    Joined:
    Jun 26, 2019
    Posts:
    2
    I'm having this problem too, and it was slowing our workflow down. I looked into it myself a bit and came up with a hacky solution to get around it till ProBuilder gets fixed. Double click the error to open the script responsible in your script editor of choice. It should bring you to the "FindNearestVertex" method. Replace what is there with this:

    Code (CSharp):
    1. protected static bool FindNearestVertex(Vector2 mousePosition, out Vector3 vertex)
    2.         {
    3.             s_FindNearestVertexArguments = new object[] { null, null };
    4.             s_FindNearestVertexArguments[0] = mousePosition;
    5.  
    6.             if (s_FindNearestVertex == null) {
    7.                 // GetMethod() would be preferred but I couldn't get it to work, it only does this once so whatever.
    8.                 MethodInfo[] allMethods = typeof(UnityEditor.HandleUtility).GetMethods();
    9.  
    10.                 foreach (MethodInfo t in allMethods) {
    11.                     if (t.Name == "FindNearestVertex" && t.GetParameters().Length == 2) {
    12.                         s_FindNearestVertex = t;
    13.                         break;
    14.                     }
    15.                 }
    16.             }
    17.  
    18.             object result = s_FindNearestVertex.Invoke(null, s_FindNearestVertexArguments);
    19.             vertex = (bool)result ? (Vector3)s_FindNearestVertexArguments[1] : Vector3.zero;
    20.             return (bool)result;
    21.         }
    22.     }
    When you hit save and open up Unity again, the package cache is going to be invalidated and the script will revert back. I found I was able to go back and do it again and it stuck the second time (until you restart Unity). Obviously you aren't supposed to edit package scripts, but this is just a hacky work around till the official fix.
     
  9. jRocket

    jRocket

    Joined:
    Jul 12, 2012
    Posts:
    568
    Is there going to be an update to ProBuilder soon to fix this? This is a pretty critical issue.
     
unityunity