NullReferenceException: Object reference not set to an instance of an object
NullReferenceException means you are trying to access a variable that has not been assigned, but there isn’t enough information to say why. The error should say the exact spot in your code that is causing the error, without that no one can say. Show the whole error, the code in question and your inspector if you want some help.