Hi
You are trying to create a MonoBehaviour using the ‘new’ keyword. This is not allowed. MonoBehaviours can only be added using AddComponent(). Alternatively, your script can inherit from ScriptableObject or no base class at all
the line to rewrite is:
mySurface = new BSplineSurface();
Many thanks, what about this line. I get an error about int
// int[ ] triangles = new int[(height - 1) * (width - 1) * 6];
int[ ] triangles = gameObject.AddComponent(int[(height - 1) * (width - 1) * 6]);
Hi Mike4,
int[(height - 1) * (width - 1) * 6] is not a component, so you cannot use it.
Perhaps you would like to have a look here, it will short things out: