Search Unity

Tutorial - Learn about Loops and Arrays in Unity C# Basics Part 2

Discussion in 'Community Learning & Teaching' started by ChrisKurhan, Feb 22, 2022.

  1. ChrisKurhan

    ChrisKurhan

    Joined:
    Dec 28, 2015
    Posts:
    268


    Hey all! Happy #TutorialTuesday!

    This is the second part in my introductory series to C# in Unity. 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 series for you! In most of my videos I expect you already know the fundamentals of writing code, but that's unfair to many of you who are just starting on your coding journey. That ends up with a lot of copy/pasting without understanding. This is the first video in a new series I'm starting dedicated to teaching absolute beginner coders how to write C#, focused on Unity.

    This video in-particular is about some critical fundamentals - Arrays and Loops. They usually go hand in hand so it just felt right to talk about them together. In this video you'll learn:
    1. What is a loop?
    2. How to write the most common kinds of loops in C#
    3. What is an array?
    4. How to use loops and arrays together to achieve some result.

    Specifically, we'll be updating an arbitrary number of TextMeshProUGUI components on a Canvas from a single script.

    As always, the full project is available on GitHub!

    If you're getting value from this series, please consider liking, subscribing, and sharing to help these tutorials reach and add value to even more people. New tutorials are posted every Tuesday!