- Home /
multi reference a specific game object to a script that it's attached to many game objects ?
Hello everyone, I face a problem where I need to reference a text component of a game object through a script. More specifically there is a script that is on two game objects and a function in the script finds the text component that I seek. The searching and referencing is made in the Start function of the script. However, although there is not null reference problem, when On play mode it seams that only one of the game objects is able to play with the Text object. The other game object has the text in the inspector but it's not able to really change it.
So here is the main question is it possible to multi reference a specific game object to a script that it's attached to many game objects ?
Answer by sisse008 · Jan 09, 2018 at 12:49 PM
yes. a game object is always passed by reference in unity.
maybe attach your script so we can understand what your trying to do