- Home /
Separate objects from GameObject[] group
So I made so that theres a [] for objects found in /Player/ItemHolder, also there will only be 2 ItemHolders in Player and the script will be located in an ItemHolder.
Now id want so that it would make a variable for a ItemHolder that is not this, and another variable for THIS ItemHolder.
How do wha help??
I don't understand, do you want 2 variables with the same name? Or 2 GameObject[] variables? Or 2 variables of ItemHolder type but only one of the should load objects from /Player/ItemHolder? Is "/Player/ItemHolder" a folder in your Resources folder?
Anyway, explain what "Player" is (is it a Script or just a GameObject in your hierarchy?), show the ItemHolder code and rewrite the line of what you want to achieve. What do you mean by "this" in this line: "a variable for a ItemHolder that is not this, and another variable for THIS ItemHolder"
sorry for not being clear enough. Player is an object and parent for ItemHolders which are also objects.
So I made a GameObject[] variable for ItemHolder objects. It finds only 2 . Id like so that I could make a variable for both of them to separate them. by this I mean ItemHolder object that contains this script, any help?
Your answer
Follow this Question
Related Questions
Scripts accessing one another (JS) 0 Answers
Find the first game object created with a given name 1 Answer
Switching Gameobjects in a variable 1 Answer
Find Transform in the scene 2 Answers
"GameObject.Find();" not working 2 Answers