- Home /
Scripts in Hierarchy attached to empty object not showing?
Hey everyone, I don't know if this is a bug or if I am just finding a hotkey feature by accident..
So I am working in my scene a while back and I have an empty object with several scripts C# attached to it. Everything is working as fine for several months when I go to change some values and I see my object in the hierarchy but there is no arrow to expand it and see its attached scripts anymore. I panic, run the build, and all the scripts are still working - and accepting changes from Visual Studio. (using the CreateVisualStudioSolution plug-in) There were some other weird things that started at the same time, such as being told everyone one of my files was updated (as in everything in the project) and should be added to the asset server, though no matter how many times I added it or downloaded what was added, it would still give the error.
Me and the coder fumble around a bit, can't find a way to bring anything back, so I back up my project folder and copy his build (only one or two script changes that I could re-do in my sleep) and everything is good - my scripts are visible again.
Except now I go back to work on it, it was looking fine the last time, and they are gone again. The only things close to errors I got were some complaining about time not being in sink between files (when I was saving my code in Visual Studio and it was being updated in Unity - I don't recall seeing this error the last time this happened though so I don't think they are related). Again, the code runs, the scripts run, I am not getting the 'everything needs to be updated on the server' error.. I just can't see the scripts in the object in Hierarchy.
I can't submit my files due to NDA, I'll try to make a new project and see if I can consciously reproduce the error but, since they seem to appear suddenly a few months apart, I figured I'd also post this as a question in case someone had a quick 'press this' solution.
Much thanks!
I have a similar problem with accessing the hierarchy. Heres a comment I made to outline the problem (I don't yet have the answer) :
Just to verify that it doesn't work, I added a blank GameObject to the hierarcy, added another blank GameObject called childGameObject to the hierarchy (and dragged it to the first blank GameObject to make it a child) I attached the following script to test :
public class testScript : $$anonymous$$onoBehaviour {
// Use this for initialization
void Start () {
GameObject getTrackPlayer = GameObject.Find
("/GameObject/childGameObject");
getTrackPlayer.tag = "Player";
}
// Update is called once per frame
}
It didn't modify the tag
From : http://answers.unity3d.com/questions/227946/using-gameobjectfind-with-hierarchies-in-csharp.html
Your answer
Follow this Question
Related Questions
How can I access a Collider's GameObject in script? 1 Answer
Unity IDE: Finding out object type of arbitrary item in Hierarchy 3 Answers
Build does behave different to editor 2 Answers
How to get a GameObject from another GameObject 1 Answer
How to destroy all gameobjects active in hierarchy? 1 Answer