Search Unity

Question Need A Way To Get Specific Vertices Of A Mesh And Modify Them

Discussion in 'Shader Graph' started by LemonMontage420, Apr 21, 2021.

  1. LemonMontage420

    LemonMontage420

    Joined:
    May 28, 2020
    Posts:
    56
    I'm making a procedural wheel shader in where you have a premade rim mesh and a tire mesh, and I need a way to get the positions of the inner vertices of the tire mesh to be the same positions as the outer vertices of the rim mesh. This problem is two fold, getting the correct vertices, as well as modifying them to match the positions of another pair of specific vertices, I'm also assuming that the number of inner vertices of the tire mesh match that of the outer vertices of the rim mesh. Any help that comes my way is greatly appreciated!
     
  2. Laurens-Paladin-Studios

    Laurens-Paladin-Studios

    Joined:
    Apr 25, 2015
    Posts:
    54
    for getting the specific vertices you could vertex mask them for example by using vertex colors... like either white is true, black is false... or better use a vertex color channel (like R G B or A)
     
  3. LemonMontage420

    LemonMontage420

    Joined:
    May 28, 2020
    Posts:
    56
    yeah i just learnt about that like 40 minutes ago lol, but the problem now is modifying them so they all go inwards, because how im modifying them now only changes their absolute positions, so if i were to add 1 to their x position, all the vertices would go to the right/left, i want it so that if i were to modify their x and y positions, for them to go to the center of the mesh