How to make a Tower Defense Game (E26 LEVEL SELECT) - Unity Tutorial

preview_player
Показать описание
Let's make a menu for selecting levels!

····················································································

Learn how to make a 3D Tower Defence Game using Unity. All code is written entirely in C#.

Difficulty: Intermediate.

····················································································

········································­­·······································­·­····

► All content by Brackeys is 100% free. We believe that education should be available for everyone.

········································­­·······································­·­····
♪ Intro Music by Brackeys
♪ Baby Plays Electro Games
Рекомендации по теме
Комментарии
Автор

A few notes regarding scrolling (in 2019, at least!):

- When I tried to scroll using the mouse wheel, it was super slow. Changing the Scroll Sensitivity to 30 on the Scroll Rect component fixed that.
- Scrolling with the wheel or click-and-dragging only occurred when I was over a button - the space in between did nothing. On the Content game object, I added a Canvas Renderer component and an Image component (no sprite, alpha turned all the way to transparent) and then it worked fine.
- If you want to hide the scroll bar when there isn't enough content to scroll, go to the Scroll Rect component and change the Visibility dropdown from "Permanent" to "Auto Hide". You'll still see it in Scene View but it'll disappear if not needed when you play the scene.

Hope that's useful to someone!

MsRedNebulaPlays
Автор

Oh man... I found you few days ago and you know, i spent like 6 month on coursera, udemy and zenva just to learn stuff i could understand by watching 2 hours of your videos! Your channel is absolute treasure. I really want to thank you, because right now i'm sure a can finish my game and upload it on Play Market.

SinedGG
Автор

Just a heads up for people following this tutorial, he uses a game object called SceneFader that is no longer available since the link to his patreon where the prefabs are located is no longer active. Because of this you won't be able to follow the tutorial 100%, but it's still possible to get the button configurations to work by following most of the video (right before he starts coding at around 15:30). After this, there is a comment a little below me from Vedant Kadam that gives the code for a scene manager script that you can attach to the Level Selector game object to get the buttons to load scenes. You may have to do more research on Unity's scene manager function to understand it though, good luck!

RegentStatue
Автор

Don't give up, keep going with the tutorials!

Lana-qpqv
Автор

Brackeys, you teach me alot! pls keep doing videos, its the best channel to learn unity :D

ElvisHrdz
Автор

One tip for the people Who are doing it in 2020
There is no screenFader ok..
you have to use
this code
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;

public class levelselector : MonoBehaviour
{

public void LOadingLevels(string nameOftheLevel)
{

}
}

and in the button on click event select the given method
which will be like
LOadingLevels(string )
;
hope so it helps someone

vedantkadam
Автор

why thia guy only has 195k subs, he deserves muuch more

neeeeeck
Автор

If anyone is after a GameSpeed slider just use this:

1. Create a UI slider. Change maximum value to 16, use whole numbers and set the value to 4.
2. Create a textbox and size it to fit "Game Speed 4.75" to get the right size
3. set the textbox as a child of the slider.
3. Create the script below and attach it to your slider.
4. Add an on value changed event in the slider, drag the slider in to the object box and select GameSpeed.ChangeSpeed
5. Drag your slider and textbox in to the appropriate fields on the slider.
6. Drag it in to your prefabs and you'll be able to reuse it for your other levels.

using UnityEngine;
using System.Collections;
using UnityEngine.UI;



    public Slider slider;
    public Text speedText;

    public void ChangeSpeed(){

       
       
    }
}

JimGiant
Автор

At the start of your wavespawner.cs script you need to make the following change, otherwise your scene will hang and never spawn enemies, if you select retry or, menu then level select, while enemies are alive in the scene being played. (Because they are not equal to zero when you hit retry or menu while the game is active)

public class WaveSpawner : MonoBehaviour
{
    public static int EnemiesAlive;
    void Start()
    {
        EnemiesAlive = 0;
    }

//everything below here stays the same

    public Wave[] waves;
...
..
.

realitycheck
Автор

5years past but still the best unity tutorial

macaronKing
Автор

Videos are awesome and entertaining, Thank you!

danbrown
Автор

what I'd like to see:
save system
level locking
level stars
upgrade paths
spells or powers
items (optional)
bosses
hide nodes
storyline? (like description of level and possible dialogue before start of level)
can you do these please?

skykillerxx
Автор

You are so awesome, keep up the great work!

nyuppo
Автор

Searching for scroll rect for couples of month and I still confuse about it, until watching this video .... great work BK

hoangminhnguyen
Автор

help me please, i cant activating SceneFader and FadeTo.

ggwrs
Автор

isn't there a way to do all of this dynamically?

TocTicTacMS
Автор

You are wonderful and the explanation is fun and very helpful
thanks alot

saadaldinqasaymeh
Автор

Great tutorial, congratulations and very thank you.

Автор

You sir, are awesome! Thank you for the help.

garrettsmith
Автор

the game glitches for me when I restart the game when the timer is on zero. The timer
does not restart and is Static with the default value, Which results in the game not starting.

Help would be much appreciated, thanks.

bronsonvanzyl