Unity: Comment Component


Do you ever think “The GameObject setup is so weird, it should be documented” but then don’t do it? Or are you forced to insert components in strange places because Unity just can’t do it any other way? Keyword: Unity’s UI rendering order is influenced by the hierarchy.


Most of the time it seems excessive to create documentation for a single component. But then a few weeks later you wonder why it’s there and everything breaks when you delete/move it? It would be handy if you could leave a comment on the GameObject. Something like ‘Do not delete/move! This is needed for the clickblocker’. Programmers comment their code, why not the GameObject setup in Unity too?



And that’s what the comment component is for. It’s a component with a text box which you can put next to weird GameObject setups. It is opened by double clicking on it and you can format it differently depending on the severity. You can choose between Information, Warning, Error.



It is especially useful when you work with several people (designers, programmers) on the same project. It keeps your colleagues from unknowingly breaking already implemented features.


It can be very frustrating when 3 people in a row delete an important component because they think it is unnecessary. Every week the same bug comes back from QA and every time it is the same component that is missing. Only the person who deleted it during a cleanup changed. This goes on until everyone on the team knows that this particular component has a purpose and needs to stay right there.


My colleague wrote the comment component and put up the source code on GitHub.