# FindWithTag returning a game object from “Preview Scene”. What is that and why is it not detecting from the active scene?

I have a script that fetches a transform using GameObject.FindWithTag("Tag").GetComponent<Transform>();. This has worked fine for a long time, but now it retrieves a transform from a preview scene(whatever that is). How do I prevent it from looking at preview scene?

• What is this preview scene that you're talking about? Can you provide some context? Consider that the FindWithTag method will return the first object with that tag found in the hierarchy. – Galandil Mar 21 '18 at 12:55
• I have no idea what preview scene is. When I make the variable public, it shows where the transform has been retrieved from "SpawnPoint(transform) (Preview Scene)". Double clicking on it selects the item but its contents in the inspector are all greyed out and it does not focus on the game object in the scene view. – Aeiou Mar 21 '18 at 12:59
• I've found this thread: answers.unity.com/questions/1381552/… which describes the same bug you're talking about. Try restarting Unity as suggested there, if it doesn't work, I guess atm you need to change how you get the reference by not using FindWithTag. – Galandil Mar 21 '18 at 13:02
• It worked. Thanks for your time. I'll accept your answer if you'll take the time to submit it. Or maybe I should delete the question? – Aeiou Mar 21 '18 at 13:07
• Sure, I'll write it. – Galandil Mar 21 '18 at 13:12

Apparently it's a bug, to make that Preview Scene go away you need to close and restart Unity.

For some users though it's not even working that close/restart trick.

I had just ran into this bug really recently, and when closing/restarting Unity doesn't work for me, I do these following things (assuming Windows, and with Unity closed):

1. Open 'Run...' and type in "%APPDATA%" (without the quotes)
• this will open you into the Roaming folder.
• delete the Unity folder within
2. Navigate up one folder, and you'll see Local, and LocalLow, along with Roaming.
• Enter each of the folders, and delete Unity from within them.

Afterwards, re-open Unity and your 'ghost tag gameObjects' should be gone. I plan on submitting a bug report to Unity, and referencing this post.