• 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
1
Question by goodguy · Jun 03, 2016 at 05:21 AM · componentscommentsnote

Is it possible to leave a comment on components like prefabs?

Hi! Is it possible to leave a comment on some components e.g. like prefabs? I'm a programmer and different sensors and other stuff that is used in code is pretty obvious to me, at least I can leave some comments for myself in code, but the artist often wonders of what is it I created in the project? I need to leave comments for him. I see it like this: he clicks on some sensor prefab and sees a text like "this sensor is used where the player should be able to climb up the wall" or "this sensor is placed where the player needs to slide down the slope" or stuff like that. Is it possible somehow? What is the best way to leave "notes" like this in unity?

Thanks!

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

1 Reply

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

Answer by Mmmpies · Jun 03, 2016 at 06:18 AM

As long As it's a brief description you could just add a readme.cs script with a tooltip in it (or add a readme section to any script attached to the prefab).

They should see that in the inspector:

     [Space(10)]
 
     [Header(" [Readme]")]
     [Tooltip("IUsed as a hand grip location for wall climbing.")]
 
     [Space(10)]
 
Comment
Add comment · Show 5 · 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 goodguy · Jun 03, 2016 at 07:31 AM 0
Share

So, is it only possible for the objects that have scripts attached? Doesn't seem to be what I'm looking for

avatar image Mmmpies goodguy · Jun 03, 2016 at 08:25 AM 0
Share

The script probably doesn't have to do anything though. Can't really test this as I don't have access to Unity right now.

Create a CS script, call it PREFABNAME-Readme.cs and clear out everything apart from the using and class name. Replace that PREFABNAME with the actual name of the prefab (so you get a unique one for each prefab) and put in the header line

 [Header("This prefab does a thing but I'm not saying what!")]

put it on the prefab and see if it shows up in the inspector. So no Start() or Update(), no code of any kind just a Header line. I think it should work without any real impact on game performance.

avatar image goodguy · Jun 03, 2016 at 09:19 AM 0
Share

Yep. This works. But it's all in one line. Is there a way to add a multiline header? Anyway, thanks for this!

avatar image Mmmpies goodguy · Jun 03, 2016 at 09:25 AM 0
Share

Again I can't check, it might respond to an escape key but more likely it won't so the simplest way would just to have multiple Header lines. I doubt it's got intelligence built in to expect a variable under the header before the next header.

avatar image goodguy · Jun 03, 2016 at 10:31 AM 0
Share

It's kind of strange Unity does not have such a trivial functionality. I think it'd be great to be able to use something like this: Inspector - Add Component - Comment Block, and so this block would be visible after one selects any object

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.

Welcome to Unity Answers

The best place to ask and answer questions about development with Unity.

To help users navigate the site we have posted a site navigation guide.

If you are a new user to Unity Answers, check out our FAQ for more information.

Make sure to check out our Knowledge Base for commonly asked Unity questions.

If you are a moderator, see our Moderator Guidelines page.

We are making improvements to UA, see the list of changes.



Follow this Question

Answers Answers and Comments

59 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

Related Questions

How to Add Notes in Inspector? 3 Answers

Freezing an object and keeping it's velocity 1 Answer

Remove component instantly and add new one 0 Answers

Components not recognized. 1 Answer

adding Character controller 0 Answers

  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges