- Home /
Question by
Seth-McCumber · Oct 04, 2013 at 06:26 PM ·
move an objectscriptable object
Enable Instantiated Object
I Need A Way So That When You Instantiate An Object, It Enables The Instantiated Object.
Thanks In Advance!
Comment
Answer by YoungDeveloper · Oct 04, 2013 at 06:27 PM
The object is automatically enabled and fully functional if you Instantiate it.
"But Your Question Is Unclear."
I $$anonymous$$now Its Already Enabled, But I Have The Object Already Disabled, And Want Them To Be Enabled Upon Instantiation
To access the gameobject after instantiation you have to save it in a temporary variable.
GameObject savedObject;
savedObject = (GameObject)Instantiate(objectToSpawn, spawnPos, objectRotation);
//I use (GameObject) prefix because in this (my) case object to spawn is prefeb.
Now you can do with it whatever you want.
If i answered your question, accept the question as answered.
Your answer
![](https://koobas.hobune.stream/wayback/20220613115321im_/https://answers.unity.com/themes/thub/images/avi.jpg)