-6

This code is basically using the code from https://gist.github.com/runewake2/b4b7bf73485222f7c5a0fe0c91dd1322strong text

I have already assigned the variable but still got this error. Can anybody tell me how? I watched this guy tutorial and he did it with this code so there shouldn't be a problem I guess.

enter image description here

derHugo
  • 83,094
  • 9
  • 75
  • 115

1 Answers1

2

The problem is that you don't initialize the property private Material material; When you create object like that you create a reference that points to null. In your code you are trying to modify this object but since it's not initialized it's null. The solution is to initialize it in the constructor like so:

public FlowLines() 
{
     this.material = new Material();
}
Ivan Kaloyanov
  • 1,748
  • 6
  • 18
  • 24