missing step?

(im using the 3d shooter tutorial and i changed the camera offsets)
i changed a script, and saved it, but when i start the player, the changes i made don’t appear to be permanent … is there something i need to do to have the player understand the changes have been made?

(i see a build&run , is it possible to just do a build(if that is what needs to be done))

Did you change a script or a prefab setting of a script(a value in the object and to the right?). If that latter is the case then perhaps you were in the play-mode when you did the change. Changes made in game-mode are temporary, and reset as soon as you go back to the editor mode. You do not have to do any build to test.

Variables set in the Inspector override the script ones, which might be the issue here. Change variables either by script OR via the Inspector.

It catches me out all the time, since I make some variables public so I can see the value while it’s playing.

i edited and saved the script file(inside the project folder) with UniSciTe(the thing that defaults when i click on the script)
the changes i made to the script are permanent , it doesn’t seem to register that it has been changed
i’ve also attempted doing build and run, and it still ignored the changes

how can i tell if im in play or edit mode?

If you have a a script with a line like this…

var speed = 0.5;

and then you change it in the Unity Editor on the properties panel to lets say 5.5, once changed in the properties panel, any change directly in the script wont be used and will be over written by your 5.5 in the properties panel.

changing 0.5 to 3.0 in script wont work.

var speed = 3.0; // wont work as you over wrote it in the properties panel to be 5.5.

im not changing it in the inspector , i’ve the c# script
and im not overriding it, with the inspector

make the variable private and try again

making it private worked, is there a reason why?

this seems to be a constant problem, i cant change any code at all, changing it to private did work… but if i want to change a function it doesn’t recognize that i have done so … and how are there public variables in the first place if they aren’t registered

that means that you had a value in the inspector which allways overrules the script vars. By making it a private var, it’s not present in the inspector anymore and the script var is the only one that would work.

bump

why are you bumping this thread ? I explained what the problem is.

you explained why changing the variables don’t work, i want to know why changing functions don’t work either, also is possible to disable the inspector ?

bump