- Home /
Way to update a Script's new variables in the inspector without loosing references?
The title says it all.
Suppose you have a Script with some reference variables, you set them on the inspector by dragging and dropping GameObjects onto them.
Then you go and add a new variable in the script, now the inspector doesn't show the new variable.
You have to reset the component for the inspector to update and get the new variable, but now it lost the references you had set.
Is there any way to update it without losing the references?
yep that shouldn't happen. Have you tried turning it off and on again?
Answer by ZenithCode · Sep 12, 2013 at 10:14 PM
That shouldn't be the case. That will only happen if you rename variables or change their scope (private > public)
Your answer
Follow this Question
Related Questions
When I try change a script var value in inspector it switches to box collider field. Is it a bug? 3 Answers
Script with variable number of variables ? 1 Answer
Assigning instances of the same script to a array-member in the Inspector 0 Answers
Changing the colour of a 3DText through script gives a weird error 0 Answers
Specifying script through inspector 0 Answers