r/unity_tutorials • • Nov 18 '21

Use tooltips! Unity Tip #2

Post image
329 Upvotes

11 comments sorted by

24

u/fL0xeL Nov 18 '21

I’d suggest just using descriptive variable names in the first place. But this could be useful for added detail.

3

u/FlyingButterGames Nov 18 '21

It is useful when your level designer wants to change some variables in the inspector.

2

u/[deleted] Nov 19 '21

The tooltip is for users that do not work with the code, but only with the Editor, it just can provide more detailed information than a good naming convention can provide. Good naming convention might be obvious to you (the developer), but not for someone using your asset.

1

u/post-Zero Nov 19 '21

I 100% agree with this. Just use good descriptive variable names and you really don't need all the extra tooltips, comments. headers, etc.

14

u/Walter-Haynes Nov 18 '21

This is kind of a bad example, number is a really fricking bad variable name.

I think it's mostly handy for extra information, not crucial information.

Take Player.sprintSpeed for instance, would be a very descriptive variable name.
The tooltip could then go into further detail, denoting that the speed is in m/s.

3

u/sneakysam77 Nov 18 '21

Love these tips. Keep em coming.

2

u/finjago06 Nov 18 '21

This is super useful, I never knew it existed

1

u/burros_killer Nov 19 '21

That's a nice tip, but wouldn't work in a lot of if not most work environments since it lacks consistently and cleanliness (clutters inspector a bit). I'd say if you think you need to use this - think a bit more on variable name. This should work like a comments in code and you don't need to comment variables in most situations.

1

u/hsadlergames Nov 18 '21

Love these. Moar plz.

0

u/DeepState_Auditor Nov 18 '21

OP, how many are you planning to make?