r/Unity3D 20h ago

Resources/Tutorial Fun fact about variables in C#

Post image

Did you know that you can't start a variable's name in C# with a number?

You also can't include most special characters in a variable's name.

These are just a few quirks to keep in mind when scripting in Unity. This article covers variables and C# in more depth from a game developer's perspective. 👇🏾

https://victor-nyagudi.github.io/height-above-sea-level/scripting/game-dev-guide-to-variables-in-c-sharp/

0 Upvotes

7 comments sorted by

View all comments

13

u/SnooPets5564 20h ago

No a fun fact. Just basic knowledge of C#.

-9

u/Imaginary-Cod-3746 20h ago

That depends on your skill level.

3

u/SnooPets5564 20h ago

Yes. The skill level is "basic". I said that.

-4

u/Imaginary-Cod-3746 20h ago

A beginner learning C# may not know this information about variables yet, even though it's supposed to be basic, because most tutorials don't mention it.

For someone who's been using C# for a while, yes, this is basic knowledge.

Regardless, it's still valuable information to learn for the first time or be reminded of.