Specific Indentation

Today marks my first day using Unity and I like it so far but there is one thing I can’t figure out that is really bothering. When I code I’ve gotten use to formatting my code a specific way, I’m going to try and show you what I mean.

if (Input.GetKeyDown(KeyCode.UpArrow)) {
    print("Up arrow pressed");
}

if (Input.GetKeyDown(KeyCode.UpArrow))
{
    print("Up arrow pressed");
}

The difference is in the squiggly brackets. The first format is what I prefer where the squiggly bracket is right after the parenthesis instead of on a whole new line if that makes sense. I can’t find where to fix that and it’s really bothering me.

This should help (assuming you’re using Visual Studio) Visual Studio Tips and Tricks – Formatting your code | Microsoft Learn

2 Likes

Thank you so friggin much!!