Error: NullReferenceException

You have to take a look into ‘LoadObstacles’. According to the stack-trace, the method tries to access a variable that has not been initialized, i.e. it doesn’t reference an object.

Also, please use code tags .