Search Unity

How can I create a plane with one smoothing group?

Discussion in 'World Building' started by suppertbw, Oct 18, 2021.

  1. suppertbw

    suppertbw

    Joined:
    Mar 16, 2016
    Posts:
    34
    Currently I use ProBuilder to create a plane and I realise the plane has several different smoothing groups. So I need to open Smoothing Group Editor to set something.

    Can I create a plane with one smoothing group?
     
  2. suppertbw

    suppertbw

    Joined:
    Mar 16, 2016
    Posts:
    34
    Ok, I get it.

    Code (CSharp):
    1. foreach(var face in pb.faces){
    2.     face.smoothingGroup = 1;
    3. }
    4. pb.ToMesh();
    5. pb.Refresh();
    6. pb.Optimize();