Unity Tips

Unity Tips

In no particular order

Sometimes all you need to do is hit “clear” in the console to make your errors go away. The console displays runtime errors from your app, one-time errors from the editor having a (maybe unimportant) issue, as well as “active, this is currently a problem” compiler errors. It can be easy to be confused by seeing an error that you have already solved, or that was just Unity being weird (especially while launching) - so try hitting clear.

Use a consistent naming scheme for public and private accessors.

For a public getter and a private setter, a private field and a public field with => is a nice way to go, because it lets you [SerializeField] the private field.

Pay attention to warnings… and get rid of them!

Use Rider. Configure IDE syntax settings to match your preferences so that when there IS a squiggly, it is worthy of your attention and helpful.

You can WaitForCoroutine in a coroutine. yield return StartCoroutine(xyz());