Question by
StoneHeartEntertainment · Jul 27, 2016 at 06:05 PM ·
variablesscriptingproblem
How can i make my script automatically use a gameobject as a variable
I have a prefab that is instantiated when the user presses "Lan host". There are three variables that need to be assigned a gameobject from different canvas objects. I would like this to be automatically selected so that i wouldn't need to drag in the canvas objects, as a normal player wouldn't be able to.
Here is a video that should hopefully show the process cleanly:
Also, I'm still new to coding so a detailed help would be most appreciated :) If i need to clarify anything please let me know.
Comment
Your answer
![](https://koobas.hobune.stream/wayback/20220612085635im_/https://answers.unity.com/themes/thub/images/avi.jpg)