Unity 2018.3, Probuilder 4 scripting

Hello, I’m having problems using the UnityEngine.Probuilder namespace after starting an empty project, using the package manager to download probuilder 4 and copying the following code into a script in the Assets folder.

ProBuilderMesh quad = ProBuilderMesh.Create(
    new Vector3[] {
        new Vector3(0f, 0f, 0f),
        new Vector3(1f, 0f, 0f),
        new Vector3(0f, 1f, 0f),
        new Vector3(1f, 1f, 0f)
    },
    new Face[] { new Face(new int[] { 0, 1, 2, 1, 3, 2 } )
} );

The problem is that it doesnt find the probuilder namespace :frowning:

The code is taken from this page of the docs About the ProBuilder Scripting API | Package Manager UI website.

I can clearly see the probuilder package in the packages folder of my project. What am I doing wrong?

Thank you for your consideration and any help you might provide :slight_smile:

You’ll need to use assembly definition files, and reference the UnityProBuilder assembly. See my post here for more details ProBuilder in-game API changes - #4 by kaarrrllll

Thank you karl, I figured it out yesterday.

I had to “manually” edit the Unity.Probuilder asmdef to set the autoreferenced value to true. I hope this will be changed in the future to be set to true by default.
By manually editing it I meant from outside of Unity with a text editor.

I tried doing as you recommended by creating an asmdef for my project which I put in the root of my scripts folder, which works! Although I also have scripts in a library folder and I also had to create an asmdef there and reference the main one to the second one.