- Home /
GUI and spawning at runtime
I built my game with a player that was in the scene and had the GUI all working correctly with sound effects for the opening of windows and the closing of windows. There are a series of prefabs with GUI scripts attached to them so when you bump into them they display a GUI window.
I used the network example file from Unity's site to bring over the needed networking elements and allow users to play together. This requires that the player be removed from the scene and be spawned in at runtime. Now, when I bump into something that once open up a GUI, it does nothing... with the exception that it's still playing the sounds for opening and closing of the GUI. So something is happening but I can't tell what.
Does the GUI script that is attached to the game object need to reference a particular camera? If so, how do I do that?
Where did these GUI elements vanish to? Man, this is a really abstract question. I hope someone out there understands what I'm saying.
Okay, it seems it didn't want to post my answer. I've been looking for something similar, but a few things that helped my GUI read properly is adding " @RPC " before and functions you want the network to calculate, such as losing health. I've seen something about attaching a NetworkID to the GUI as well, but haven't looked into it. Send me a personal e$$anonymous$$ail and I'll keep in touch with anything I find. I'm sorry I can't give you a cold hard answer for it.
Answer by 88bueno · Apr 12, 2012 at 09:28 AM
Not an answer, not too sure on this, but I think it has something to do with RPC functions. I know I've been running a similar project, and my GUI wasn't doign the math on losing health until I put the losing health in an individual function and prefaced it with " @RPC " before the word function. I will keep looking, but maybe this can be used to help you. I think I saw something about assigning a NetworkID to the GUI? Hope this helps. Send me a personal Email and I will keep in touch if I find an answer.
Your answer
Follow this Question
Related Questions
FLYING from Camera Position A to B per Buttom click? 5 Answers
GUI Window on GameObject location? 1 Answer
GUI Label over network??? 0 Answers
Is there a way to change the order of the "Layers" Tab? 0 Answers
GUI button disappears 0 Answers