Unity Coding Basics Part 1 - Writing Your First Script
If you've been using Unity for a while, or are just getting started with Unity and decided it's time for you to start learning how to write code - this is the video you need to start your programming journey!
In this tutorial repository (with associated video), aimed at absolute beginners who have very little to no coding experience whatsoever, you'll learn:
- Installing Visual Studio to write code
- What is a "Script"?
- Creating your first Script
- What's going on with the default stuff in your new script?
- A step-by-step breakdown of what each statement is doing, why it's happening, and how it works.
- How to make numbers on the screen count up over time
YOUR HOMEWORK!
Create a new script that will show a random number between 0 and 1 and display that on a TextMeshProUGUI component, formatted to 2 decimal places.
Add a comment below with a video showing your code and the end result.
Resource to help you, as promised: https://docs.unity3d.com/ScriptReference/Random.html
For those looking to get ahead of the next video, consider some further reading on resources I brought up during this tutorial
- https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/strings/
- https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/builtin-types/floating-point-numeric-types
- https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/language-specification/types
- https://docs.microsoft.com/en-us/dotnet/csharp/fundamentals/types/classes
- https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/classes-and-structs/access-modifiers
- https://docs.microsoft.com/en-us/dotnet/csharp/programming-guide/concepts/attributes/
- https://docs.microsoft.com/en-us/dotnet/csharp/language-reference/statements/selection-statements
- https://docs.microsoft.com/en-us/dotnet/standard/base-types/standard-numeric-format-strings

Patreon Supporters
Have you been getting value out of these tutorials? Do you believe in LlamAcademy's mission of helping everyone make their game dev dream become a reality? Consider becoming a Patreon supporter and get your name added to this list, as well as other cool perks.
Head over to https://patreon.com/llamacademy to show your support.
Gold Tier Supporters
Silver Tier Supporters
- Raphael
- Andrew Bowen
- Gerald Anderson
- YOUR NAME HERE!
Bronze Tier Supporters
- Bastian
- Trey Briggs
- AudemKay
- YOUR NAME HERE!
Other Projects
Interested in other AI Topics in Unity, or other tutorials on Unity in general?
- Check out the LlamAcademy YouTube Channel!
- Check out the LlamAcademy GitHub for more projects
Requirements
- Requires Unity 2020 LTS or higher.