Search Unity

Probuilder 4. Where did GetFaceWithTriangle go?

Discussion in 'World Building' started by look001, Jan 8, 2019.

  1. look001

    look001

    Joined:
    Mar 23, 2017
    Posts:
    111
    Hi everyone,
    i am currently using probuilder4.0.0-preview.34. I like the preview. For my new Project I want to use the new scripting api. I want the user to select a face at runtime for extruding later. With the old api i used the triangle Index of the RaycastHit. After that i figured out the face with GetFaceWithTriangle(). However it looks like this function no longer exists. Furthermore i noticed that the face picking moved to Editor only with a custom probuilder RaycastHit that contains the selected face. I can't use it at runtime, since it uses the HandleUtility from UnityEditor to get overlaying gameobjects. What can i do to figure out the faces under the mouse at runtime?
    Thank you! This might be a question to developer in specific. Thank you so much for this tool!
     
    Last edited: Jan 8, 2019
  2. kaarrrllll

    kaarrrllll

    Unity Technologies

    Joined:
    Aug 24, 2017
    Posts:
    552
    look001 likes this.
  3. SentientSkull

    SentientSkull

    Joined:
    Apr 26, 2013
    Posts:
    75
    Where do you get Probuilder 4 preview? I search for it and never find anything.
     
  4. look001

    look001

    Joined:
    Mar 23, 2017
    Posts:
    111
    Thank you, very good examples!
    Go in the packages folder inside of your project root folder. There should be a manifest.json. Open it and edit it like this:
    Code (CSharp):
    1. {
    2.   "dependencies": {
    3.        ...
    4.        "com.unity.probuilder": "4.0.0-preview.39"
    5.    },
    6.   "registry": "http://staging-packages.unity.com"
    7. }
    You can do this while you have your project opened. Unity will update it automatically. Also make sure you have Unity 2018.3+ for preview.39. You can find out about the newest staging versions on bintray
     
    Last edited: Jan 11, 2019
  5. SentientSkull

    SentientSkull

    Joined:
    Apr 26, 2013
    Posts:
    75
    Thank you. I saw this being mentioned but never had a clue as to how to get it.