I have a script with a public variable as a reference to a prefab. I have set the variable in the inspector and a print(reference) give me the correct prefab at almost every point in the code. but in one public function the reference isn’t set anymore and i get the error that i have to assign it in the inspector. A print in that function also returns null. But any print in update after that Returns the correct results again. What is possibly happening here ?
I got it sorted out. I changed it so the function is called from inside the script and receives the parameters from the other class. It works fine now. Thanks for trying to help anyways