- Home /
unlikely that anyone have a solution for it since it's most likely to be a rare unity bug.
Phantom / ghost reference throwing null reference error
sometimes when i search for all objects using FindGameObjectsWithTag, it somehow creates a null clone of some object and returns that along with other found object , causing null reference exception when i try to access the array.
i've tried printing a list of found objects and it returns all viable objects, including a 'clone', but when i searched in my scene i couldn't find anything like that.
restarting unity can resolve that problem, but i'd like to know what is causing these phantom object problems because it keeps popping up now and then and having to restart unity every time is just a hassle.
so... anyone have any ideas?
Nothing pops to the top of my head. If nothing comes up here consider submitting a bug report.
I've had this issue multiple times too. Even had a time where unity selected an object for me in the inspector, which was not even present in the scene (I guess this is also your issue). I've not found any way to deal with this, so I've got to agree with Bored$$anonymous$$ormon: a bug report might just be the only solution. Very eager to see IF anyone solved this.
just submitted a bug report to unity, like what Bored$$anonymous$$ormon suggested.
interesting note: i ran into this problem again and guess what happens? this time it creates even more phantom clones. talk about getting trolled, ha.