Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
2 captures
12 Jun 22 - 14 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
5
Question by victorknai · Jul 20, 2017 at 12:51 AM · scripting problem

FindWithTag object is referenced as "Preview Scene"

Hey,

Bumped into an issue I've never seen before. As I'm using the line gemRaysObj = GameObject.FindWithTag("GemRays");the script finds the object, but adds in parentheses "(Preview Scene)" after the name. If I click on the supposed referenced file in the inspector, it doesn't appear in the scene hierarchy. Any thoughts on what might be going on?

Cheers

Comment
Add comment · Show 2
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image ewan000 · Aug 21, 2017 at 12:32 PM 0
Share

getting the same thing all of a sudden with GameObject.Find did you ever find the solution?

avatar image ewan000 · Aug 21, 2017 at 12:44 PM 0
Share

ok restarting unity fixed it. odd

5 Replies

· Add your reply
  • Sort: 
avatar image
1

Answer by mephistonight · Nov 25, 2017 at 07:03 AM

I've also been running in to this. Restarting Unity definitely helped but I'd really like to know what's causing it as packing arrays with gameobjects for later reference, based on the array's length is something I do all the time and this breaks the array length when finding all gameobjects with a tag. It seems as though gameobjects are not being fully destroyed in the editor when entering and exiting play mode.

Anyone any ideas?

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by ALG2132 · Jul 30, 2017 at 01:38 PM

Hi, @victorknai,

First of all, using GameObject.FindWithTag("ExampleGameObject"); is something I and most people don't use. (it may seem simple but doesn't seem to work now.)

What's recommended is to use public GameObject ExampleGameObject;.

And then to call a function on the gameobject use ExampleGameObject.MyFunctionGoesHere;

I would suggest parenting if you're working with multiple gameobjects and define the parent in the inspector to be called with your function.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by MrEdens · Sep 06, 2017 at 04:34 PM

@victorknai,

I had the same issue and some of my scripts where not working as expected at the same time. I restarted Unity and the preview scene was gone and my scripts started working again. Try restarting Unity.

Hope this helps.

using Unity 2017.1.0f3

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image entropicjoey1 · Feb 05, 2018 at 05:09 AM 0
Share

restarting it is no longer working for me x// idk what to do, have to drag the object manually for testing, its not a major pain but just shouldn't be happening anyways >.< any one figure this out? using 2017.3.03 and no longer fixes on restart

avatar image KarlKarl2000 entropicjoey1 · Jun 29, 2018 at 06:16 AM 0
Share

I ran into the same problem too. So annoying. Have you tried to delete your entire Library folder and let Unity recompile everything? (Or move it somewhere else if you want to be safe)

Sometimes I find that works for me, to fix shader glitches.

avatar image
0

Answer by fahadshafique · Mar 13, 2019 at 12:43 PM

i had the same problem....just restart unity...hopefully it will work...it is bug in unity !

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by Mamoon178 · Apr 17, 2019 at 08:00 AM

Just delete your scene from build setting and add again. then this problem is remove. its not any bug in unity

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

156 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Trying to restrict movement to bounds of screen using MathF.Clamp() 2 Answers

help! i am a newbie here and i got a problem in scripting 0 Answers

Why Collider2D size Y changes affects child object position 0 Answers

Why is my cube not following the other the way i want ? 1 Answer

How to Undo a lot of created objects at once? [Solved] 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges