In this lesson, I teach you the easiest way to flip or toggle a bool variable in C# for Unity. This is done by having your destination variable followed by the equals operator and the exclamation operator in front of the source variable and in this case the destination and the source should be the same variable.
Tag: tips
How to Use Random Range in C# for Unity
When coding for Unity in C# the Random.Range function is a very helpful function that I use all of the time. This function can be used to generate random behaviors in your game.
The most important to remember when using the Random Range function is that you must have the second parameter be plus one more than the highest number you wish to include when using ints. The reason for this is that the Random Range function normally uses float and like when you case afloat into an int, whatever decimal numbers you have will be removed never rounding up.
How to Uninstall Unity Editor from Unity Hub
To install more modules or build supports for a certain version the Unity editor, first, open up Unity hub. Then click on the Installs tab. From here you will need to find the version of Unity you need the additional modules for. Click on the three-dot dropdown menu and select add modules. You can then check the box for each module you wish to install. Afterwhich click Done. Depending on your computer, network connection, and how many modules you selected, the installation process will take several minutes to install.