Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 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
3
Question by JakeElliott · Jan 26, 2011 at 11:59 PM · editorsceneviewgizmos

Labeling objects in the scene editor view

I'm working on a scene with a lot of objects that are visually identical but which I need to see the game object name for. I looked at using the OnDrawGizmos() method, but there doesn't seem to be a Gizmos.DrawText or similar. Is there a way to write the object's name next to it in the scene editor view but not in the game?

Comment
Add comment
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

2 Replies

· Add your reply
  • Sort: 
avatar image
9
Best Answer

Answer by yoyo · Jan 27, 2011 at 01:10 AM

See Handles.Label for information on how to draw text in the scene view.

Handles is an Editor class, so you'll need something like this in a script in your Editor folder (C#):

[DrawGizmo(GizmoType.SelectedOrChild | GizmoType.NotSelected)]
static void DrawGameObjectName(Transform transform, GizmoType gizmoType)
{   
    Handles.Label(transform.position, transform.gameObject.name);
}

Note that this adds a gizmo for every Transform in the scene, so it will show for every game object.

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 Horothenic · Jan 27, 2019 at 01:24 AM 0
Share

Share the full class, it was difficult to find a post sharing the complete class, since this has to be an editor for Transform or GameObject

avatar image AleMarcati · Mar 26 at 02:37 PM 0
Share

Is there a way to search the scene for all objects that are assets with a certain label? I'm trying to search l:Dynamic for objects that have the Dynamic tag but it only finds in the project, not in the scene.

avatar image
2

Answer by Dacke · Apr 26, 2016 at 10:37 PM

And for some other color:

 GUIStyle style = new GUIStyle(); 
 style.normal.textColor = Color.red; 
 Handles.Label(transform.position, transform.gameObject.name, style);





Comment
Add comment · Show 1 · 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 AleMarcati · Mar 26 at 02:37 PM 0
Share

Is there a way to search the scene for all objects that are assets with a certain label? I'm trying to search l:Dynamic for objects that have the Dynamic tag but it only finds in the project, not in the scene.

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

Select object by selecting gizmo or handle? 1 Answer

Is it possible to draw gizmos when an object is selected, but not when the parent is selected? 2 Answers

How to make a custom gizmo like 'Grid' or 'Axis'? 0 Answers

unity: scene shows nothing, PLEASE HELP 1 Answer

What is the best way to fix texture z-fighting? 5 Answers


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