Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 14 Next capture
2021 2022 2023
2 captures
13 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 /
avatar image
1
Question by Nyxo · Mar 19, 2013 at 05:04 PM · editordebuglogcontext

Is there a way to force Debug.Log(string, object) to ALWAYS draw the context?

I'm outputting many lines using calls to Debug.Log(string, object), and in unity, I'm relying on the feature of drawing a highlighting outline around the context GameObject in the hierarchy tab when I click on a log item in the console tab.

However, the way unity currently highlights the context GameObject is that it draws a rounded rectangle around it in the Hierarchy tab, which later fades out. The strange behaviour I'm seeing is that the highlight doesn't get redrawn if the context of the newly-clicked-on log item is the same as the context of the previously-clicked-on log item.

This is causing me problems because some of the context GameObjects for log items are invalid (ie not in the scene anymore) and thus, really SHOULDN'T be getting a highlight drawn in the hierarchy tab, so it's becoming a real pain to figure out whether the log item I clicked on has an invalid context GameObject, or if it's just the SAME context GameObject as the previously clicked on log item.

The only workaround I've found is to have a "dummy" log item with a known context GameObject (that will never be the context for any other log item), and I have to click on that log item in between clicking any other log items in the console tab, to force unity to redraw the highlighting outline in the hierarchy tab. This is a real nuisance, especially when I have hundreds of log items I need to be looking thru and comparing context GameObjects for.

So is there a setting somewhere that I can change, or some code-accessible internal variable/method that will allow me to "reset" the most recent context Unity drew a highlight for, or something?

Comment
Add comment · Show 4
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 TheGameLearner · Nov 28, 2020 at 02:47 PM -1
Share

Hey, just reached this when searching how to highlight a gameObject from the console. I want my singleton player code to highlight the object I collided with. Did you ever find the answer to this problem? Can you share if you did?

avatar image Nyxo · Nov 30, 2020 at 03:38 PM 0
Share

No, I never found an answer :( But this was quite a while ago, so perhaps it's been fixed since? It's been a really long time since I have worked on that project at all, let alone that particular piece of debugging code.

avatar image TheGameLearner Nyxo · Dec 18, 2020 at 03:09 PM 0
Share

Hey, found the answer after a while. thanks for replying.

avatar image Nyxo TheGameLearner · Dec 26, 2020 at 06:31 PM 0
Share

Can you share the answer here for others who also come across this post, please?

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by TheGameLearner · Jan 19, 2021 at 11:25 AM

I used the code from here link text to highlight a context.

I added it manually when I selected a Context.

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

13 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

Related Questions

Prevent editor-prev.log file from getting too big 1 Answer

How can I find editor log file? 5 Answers

Generic Debug Message 1 Answer

How do I keep Debug.Log in archive/release iOS builds? 0 Answers

Debug.Log() remove callstack ? 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