public inspector variables

Hello,

I was wondering if I have a public speed variable set to 10 in a script, but in the inspector I set it to 15 when I build the game to upload to webGL will the speed variable be set to 10 or 15 when I play the game in my broswer?

Thanks

15.

10 in the script is only the preset value if you add the script to a gameobject.

1 Like

You don't even have to make a build, it takes effect in editor Playmode too.

1 Like

[quote=“sumpfkraut”, post:2, topic: 911556]
15.

10 in the script is only the preset value if you add the script to a gameobject.
[/quote]
if I attach the script to a gameobject and then change the speed value to 15 in the inspector will the speed value still be set to 15 when I upload the game to webGL?

[quote=“super_mario92”, post:4, topic: 911556]
if I attach the script to a gameobject and then change the speed value to 15 in the inspector will the speed value still be set to 15 when I upload the game to webGL?
[/quote]
Yep, the value in the editor is the one it takes.

1 Like


thank you!