- Home /
Inspector not refreshing
Hello, i have problem, because my inspector working bad from 2 days...
For example i have script:
using UnityEngine; using System.Collections;
public class test : MonoBehaviour {
public int testa = 1253;
// Use this for initialization void Start () {
}
// Update is called once per frame void Update () {
} }
And in my inspector i see "Testa: 1253", but when i change it in script to for example 123 still i see 1253, i need to click "reset" in inspector to refresh it, can you tell me why? I'm working with unity from long time and i never have problems like it.
Thanks for help.
///I checked and can't find anything about THIS PROBLEM here... Everytime i need update that i have to call 'Reset' in inspector.. why?
Answer by Piflik · Mar 11, 2015 at 09:20 AM
This has always been the case. If you edit values in the Inspector, they retain their value, even when you change the value in the script.
If you want to prevent this, you can hide the variable in the inspector by typing [HideInInspector] above the variable declaration. It will still be a public variable, but you won't be able to edit it in the Inspector.
But when i change it in script it stau like i said in inspector and in unity, i need click Reset in inspector to unity read this value good.