[Official Unity Learn Event] Learn-Along featuring TANKS! - REMASTERED FOR UNITY 6 - on Unity Learn!

Hello Unity Community!!! We’re back again with our next Learn-Along featuring the TANKS! tutorial - REMASTERED FOR UNITY 6 - on Unity Learn! :nerd_face:

From 2025-05-01T00:00:00Z2025-05-21T00:00:00Z, our Unity Community team members and Unity experts will be standing by on this thread to support you with any troubleshooting or encouragement you need to complete this classic tutorial, remastered for Unity 6!

Who is This Learn-Along For?

Are you just getting started on your game development journey and looking for a solid challenge after your first few tutorials? Have you used Unity before but haven’t been in the Editor in a while/are trying to improve your game dev skills? Are you a teacher looking for an exciting and accessible introduction into Unity and game development?

If you said yes to any of the above, this Learn-Along is just for you!

How Do You Start the Learn-Along?

Start the Tanks! Learning Project on Unity Learn by clicking here! You’ll be greeted with the individual tutorials that make up the Tanks! project. This content is self-paced so please take your time and, most importantly, HAVE FUN!!!

What You Will Learn?

While following along with Tanks!, you’ll:

  • Establish a structured and functional Unity scene for the Tanks game by configuring the Unity Editor.
  • Configure your tank’s movement with user input, collision detection, engine audio, and dirt trails behind its tracks.
  • Set up a dynamic camera system and refining lighting to enhance the game’s visuals.
  • Set up the tank’s shooting system, allowing your tank to fire shells.
  • Implement a radial health slider with an added explosion effect when a tank’s health reaches zero.
  • Add an AI-controlled enemy tank with a new tank model, speed, strength, and health characteristics.
  • Add background music and configure an Audio Mixer to balance the sounds in your game.
  • Create a Title screen, set up a Game Manager, and add a Player Selection screen.
  • Add mobile controls and publish your game to Unity Play!

What Do I Do After I Complete The Tanks! Project?

Your journey is not over!!! After completing the Tanks! Learning Project, we highly encourage you to “remix” your game and add your own unique touch to Tanks!

Follow this link to a special tutorial that will help you Make Tanks! Your Own! We suggest ways to redesign + add to Tanks and we want to see what you will come up with!!!

Explore tips for building on your Tanks! project. Learn how to redesign your levels, change the tank colors, add a pause menu, add powerups, any many more!

Submit to the TANKS! Learn-Along Showcase on Unity Play!

When you’ve completed your own very special version of Tanks!, you’ll be able to submit you’re work to the Tanksl Showcase on Unity Play to be considered in one of these five categories:

:medal_sports: Best Overall
:partying_face: Most Fun
:tv: Best Graphics
:headphones: Best Sound
:face_with_monocle: Weirdest (Up to interpretation. Art is subjective, yeah? Haha.)

Post In This Topic With Any Questions Throughout The Week!!!

As mentioned above, the Unity Community team and Unity experts will be standing by on this thread to support you with any troubleshooting or encouragement you need!

Please keep posts on-topic, be respectful + kind, and don’t be afraid to jump in and help your fellow learners as you all go along this journey!!!

Thank You So Much!!! Happy Learning!

On behalf of the Unity Learn and Community team, Happy Learning and tank you for joining us!!! :sunglasses::sunglasses::sunglasses:

6 Likes

The “Tanks Showcase on Unity Play” link is incorrect, it points to “roll a ball challenge”. Should link to this:

Thanks for the catch, @CodeSmile! Switching it over now! Also - hope you’ll be around for the Learn-Along answering questions, yeah? :slight_smile:

1 Like

On this thread? For sure! I’ll be porting Tanks! from C# to Lua alongside over the coming days.

1 Like

Hi everyone, I’m Attilio, Staff Engineer and Technical Lead at Unity.

I’ll be around to help with any questions you might have during the event.

Have fun!

2 Likes

Hello, Can I use the different model assets? Like tank models or create my own levels?
Do I need to use anything from Tanks Tutorial/Asset? Or the competition is like Game Jam titled “Battling Tanks”?

1 Like

Yes sure. You can replace just the Mesh of each tank, or duplicate the prefabs and modify them extensively. You will have to assign the new prefab (variant) in each scene’s GameManager to have the game use your version.

And to make more levels, just duplicate one of the scenes. Again you will have to tell the game to load that new scene at some point. I haven’t found where the level scenes are referenced though but probably in the GameManager script.

Like @CodeSmile said - you can totally use your own assets! It would just be a matter of modifying the Prefabs provided in the sample project.

Feel free to go wild with it!

Hi Everyone,
I’m Chris, a senior software guy at Unity. I’m here to help out with any questions you may have in your journey with the remastered tanks tutorial. I had a lot of fun with the original and so I’m looking forward to trying out this new one along with you.

Feel free to tag me in a post with a question and I’ll do my best to get back to you in a timely manner.

Best of luck, and have fun learning!

1 Like

Will unity visual script be supported?

Because thats what im able to use. And this tank game sounds interesting - learn to put the things together, arm the system and publish it on unity play.

I dont know what unity play is… But it seems fun to do a micro project that may turn into something!

Tanks are cool :nerd_face:

1 Like

This is a (potential) issue in GameUIHandler (Menus prefab) which references the GameManager that exists in the scene:

I would suggest modifying this so that the GameManager is “found” since it often comes wholly unexpected that the prefab will “lose” the reference to an in-scene object/component.

2 Likes

FIXED:
I had not noticed that the RectTransform ‘Anchors’ property was collapsed so I didn’t notice the different anchor values. :wink:
It’s visually easy to overlook in part due to the odd spacing of items in RectTransform:


I do have a question. :slight_smile:

I made my own copy of the Menu prefab, and dropped in my own copies of the TankSection prefabs to the StartMenu. Now my StartMenu looks like the upper one, whereas the original Menu prefab (below) has all StartSection elements distributed evenly:

I double- and triple-checked that all values are the same, RectTransform definitely matches, anchoring matches, there is no layout group in the parent(s), this is in scene view outside playmode (no scripts involved). I’m stumped, and it feels like one of those UGUI quirks.

So… how do I get these StartSection instances to align in columns like in the original StartMenu?

I could drag them in place but I want to understand this issue and get it right.

2 Likes

Cool to see Tanks redone, after all these years!

This image smells like Stefano… am I wrong? :slight_smile:

1 Like

Hi, @Litoid! As far as I know - the course is in C# but you can port the scripts over to Visual Script if you’d like! That being said, YMMV that includes converting the Scripts that were provided with the sample project yourself.

If there’s anyone in here who’s a Visual Scripting wiz and can help, def chime in!

@CiroContns!!! Good to see you on this thread!

You are absolutely correct, these are all a Stefano classic (context for everyone in here - Stefano is our super talented Senior 3D Specialist for the Learn team. :slight_smile: )

Will make sure he sees this! Hope you stick around and jam with us + help some ppl out, Ciro!

1 Like

Funny enough, we’ve used Tanks assets in a submission for CrazyWebJam2025 that just ended!

5 Likes

Just some observations that keep bothering me … :wink:

TankManager are SpawnPoints?

There’s a specific mismatch between type name, variable name, and usage which I find confusing.

TankManager => This isn’t a “manager” type, it’s just a C# data class. It would be better named TankData

Those TankManager instances in GameManager then become “spawn points”, presumably to be less confusing in the Inspector but that confusion then carries into the code instead:

public TankManager[] m_SpawnPoints;

From the programmer’s perspective:

Huh? How come a TankManager is a spawn point? :thinking:


And whenever we iterate over spawnpoints the comments actually tells us to “go through all the tanks” or most notable, just calling an item of a spawnpoint a tank as seen in SpawnAllTanks:

            foreach (var tank in m_SpawnPoints)
            {
                if (tank.m_Instance == null)
                    continue;
                
                tank.Setup(this);
            }

This is really something that makes the code much harder to follow. If only it were m_Tanks and with the custom Inspector drawer it would actually read “Tanks” with sub-elements named “Spawn Point”. Right now it’s kinda like: “Spawn Points” - “Spawn Point” - “SpawnPoint” but the code makes me re-imagine these “spawn points” as tanks:

StartGame() calls GameStart()

Also rather strange and confusing is having these methods in the GameManager:

  • StartGame(..)
  • GameStart(..)

It’s mostly the latter which at the very least should be GameStarting or just tell what it does eg SpawnTanksAndStartGameLoop or similar.

DisableControl vs EnableControl

This is just undesirable code duplication:

        // Used during the phases of the game where the player shouldn't be able to control their tank.
        public void DisableControl ()
        {
            m_Movement.enabled = false;
            m_Shooting.enabled = false;
            if(m_ComputerControlled)
                m_AI.enabled = false;

            m_CanvasGameObject.SetActive (false);
        }

        // Used during the phases of the game where the player should be able to control their tank.
        public void EnableControl ()
        {
            m_Movement.enabled = true;
            m_Shooting.enabled = true;
            if(m_ComputerControlled)
                m_AI.enabled = true;

            m_CanvasGameObject.SetActive (true);
        }

Instead this should be controlled by a bool argument:

        // Used during the phases of the game where the player should be able to control their tank.
        public void EnableControl(bool enable)
        {
            m_Movement.enabled = enable;
            m_Shooting.enabled = enable;
            if (m_ComputerControlled)
                m_AI.enabled = enable;

            m_CanvasGameObject.SetActive(enable);
        }
2 Likes

Question: Why are we setting the tank inactive and active again?

In TankManager:

        // Used at the start of each round to put the tank into it's default state.
        public void Reset ()
        {
            m_Instance.transform.position = m_SpawnPoint.position;
            m_Instance.transform.rotation = m_SpawnPoint.rotation;

            m_Instance.SetActive (false);
            m_Instance.SetActive (true);
        }

I know this can sometimes be useful to force some “internal update” but what effect does it have in this case?

1 Like

I noticed there’s code that has no effect in TankManager.Setup():

            // Assign the Input User of that Tank to the script controlling input system binding, so the move/fire actions
            // get only triggered by the right input for that users (e.g. arrow doesn't trigger move if that input user use WASD)
            var inputUser = m_Instance.GetComponent<TankInputUser>();
            inputUser.SetNewInputUser(m_InputUser);

We call SetNewInputUser with our field but this m_InputUser field is never assigned to, and not used elsewhere. Therefore it is never valid and SetNewInputUser exits early. The input user is set through a different code path. The above code in the tank Setup method has no effect and the field could be removed. In fact I just did so and noticed no adverse effect.