Search Unity

Probuilder API mesh transform and vertices

Discussion in 'World Building' started by stychu, Jan 26, 2021.

  1. stychu

    stychu

    Joined:
    May 9, 2016
    Posts:
    62
    I'm trying to move my newly created plane shape to a specific location.
    I would like to move my 1x1 plane generated by ShapeGenerator and place the mesh at some specific position for e.x. vector3(3,0,3).

    If I do it like that

    ProBuilderMesh mesh = ShapeGenerator.GeneratePlane(PivotLocation.FirstVertex, 1, 1, 0, 0, Axis.Up)

    mesh.transform.positon = new Vector3(3, 0 ,3);

    It moves the mesh to the position but IT DOESN't moves the vertices of the mesh.

    How I can translate the vertices so they math the object position??