- Home /
GUI does not work in network (but does work in scene/editor)
I have a scene with an OnGui script. In that scene, the user can set variables in the script through buttons, toggle buttons and a text field. This works fine when the scene is built separately, it also works in the editor. It does not work when built in my final application though. This is a networked application (Unity built in networking) with several scenes) When the scene is loaded, the toggle buttons, buttons and input field don't work. Has this something to do with variables and networking? To me it seems unlikely that RPC calls are necessary in this case? I can't figure out why it is not working. The scene has one script, and it works separately, so I don't know how networking could be involved in this issue, but it seems to be, otherwise it should just work?
Ok, I just found out the variables are stored, but only for an instant. It looks like the variables are not stored in the OnGUI() void. In the network controller script the variables are stored and maintained. Why are the variables in a new scene with another script reset all the time? Are variable returns required?
Your answer
Follow this Question
Related Questions
Are C# Global Variables Safe In Unity? 5 Answers
Help needed for begginer. With scripting items. 1 Answer
AudioClip stuttering while loop is OFF and not using function Update? 1 Answer
How to READ a variable VALUE from other Object Script? 1 Answer
I'm unable to clear a variable that is used in multiple scripts. 0 Answers