Level Up! How to make a Scalable Level System: Unity Tutorial

Поделиться
HTML-код
  • Опубликовано: 28 мар 2021
  • An advanced scalable level system that allows customisation to suit your game!
    In this video we cover:
    •Setting up UI elements.
    •Adding experience to the player.
    •Leveling up and calculating required Xp for next level.
    •Changing player attributes.
    Project Download
    drive.google.com/file/d/1oarP...
    Runescape Level Scaling Wiki
    oldschool.runescape.wiki/w/Ex...
    Coding With Unity: Unity3D - Level Scaling for beginners
    • Unity3D - Level Scalin...
    Thanks for Watching!
  • ИгрыИгры

Комментарии • 49

  • @helicopterkat1697
    @helicopterkat1697 11 месяцев назад +4

    this is two years old but you just fixed everything thank you so much

  • @tagscientist
    @tagscientist 3 года назад +1

    Excellent stuff, thank you. You are a very clear speaker - I look forward to more of your tutorials.

  • @MarkayCS
    @MarkayCS 2 года назад

    Oh. My. God. This has to be the best video I have ever seen on RUclips, without a doubt. Such great information and a clear tutorial!

  • @theillestones1350
    @theillestones1350 Год назад +2

    Good tutorial. One thing to keep in mind when doing xp leveling systems, is that animation curves go a long ways!

  • @Ma_cieK
    @Ma_cieK Год назад

    This is awsome bro. Great work !

  • @sassuskrassus3166
    @sassuskrassus3166 3 года назад +1

    i just watched a 50 minute video before and couldn't follow shit at all
    your videos are well done and i got what i wanted
    keept it up

  • @user-nn6yf9yj6b
    @user-nn6yf9yj6b 2 года назад

    Thanks a lot for your tutorials and your voice is charming !! have a good day

  • @Noir-Road
    @Noir-Road 2 года назад

    BullsEye !
    This is exactly what I need. Cheers !

  • @chaineprogrammation7797
    @chaineprogrammation7797 Год назад

    Un grand merci depuis la France.
    Thanks !! 👍👍

  • @weebaki2994
    @weebaki2994 3 года назад

    Thank you ,great tutorial :D

  • @dctzeng
    @dctzeng 7 месяцев назад

    Thanks you for your selfless and generous sharing

  • @Astrobot01
    @Astrobot01 3 года назад +1

    Very Good Tutorial

  • @RazorianBuck
    @RazorianBuck 3 года назад +3

    Your tutorials are really good.

  • @saraschroder7523
    @saraschroder7523 Год назад

    Watched so many tutorials that didn't work before I found this one! Amazing! Thank you :)

    • @saraschroder7523
      @saraschroder7523 Год назад

      I would also like to ask the question how I can implement the GainXP functions from another script. No matter what I try I get an error "unreachable code detected". I have my level system script attached to my canvas on my main menu screen. Everything works as intended. What I am hoping to implement is during gameplay if a player does something (OnTriggerEnter etc), they gain xp. They cannot see the gained XP until they return to the 'base' which is the main menu, so two different scenes. I have tried making the level system a static instance, I have tried adding the level system to a game object in the game scene as well as the main menu scene, using a boolen to try to reference it. Nothing works. I would be so grateful if you could help me out with this! :)

  • @dariuszwesierski1928
    @dariuszwesierski1928 Год назад

    Thx man!

  • @GreenGnoblin
    @GreenGnoblin 3 года назад +1

    very nice video! keep up the good work.
    Don't forget that you can use serializefield variables to keep them private but you still want them to appear in the inspector.

  • @priyamvadasharma26
    @priyamvadasharma26 Год назад

    thank you so much for creating this video I was looking for this kinda video, and after lots of searching finally I got the correct video thank u so much for mentioning the beginner-level scaling video it was also so useful for people who. are beginners in unity.

  • @tredutore
    @tredutore Год назад

    nice

  • @Geckotr
    @Geckotr 8 месяцев назад

    Nice tutorial but i can't find the project on the link you shared, there are a lot of folders with numbers on them. I don't know which ones contain the project files

  • @faustoyoshihara6747
    @faustoyoshihara6747 Год назад

    Uau, thx Man

  • @brianjensen2532
    @brianjensen2532 3 года назад +1

    AnimationCurve would work too. Nice visualization though.

  • @coopergaffney2012
    @coopergaffney2012 Год назад +1

    How do i get the health bar to stop moving when i expand my screen in unity. I did it the whole set native thing but everytime i expand or shrink my screen the whole bar moves with it and i have to physically move it to fit the screen size or just not expand my screen.

  • @user-hk9gz9bg6n
    @user-hk9gz9bg6n 2 года назад

    hi, i've tried the same but when i play, the bar is always 100% for whatever the fraction is ( 0

  • @inquisitive240
    @inquisitive240 Год назад

    GOAT LEGENT

  • @ayehavgunne
    @ayehavgunne 2 года назад +1

    Every time you say fillAmount I hear ‘fill em out’

  • @injusticedmoney4929
    @injusticedmoney4929 3 года назад +2

    Great tutorial! The most straight to the point yet complete leveling tutorial for Unity out there :) Keep up the great work.
    Just a small question: This system scales even harder than Runescape I guess, because in Runescape whenever you level up, your experience doesnt reset, example : lvl1: 0/83 - lvl2: 83/174, when in your system we get lvl2: 0/174, right? At least thats what I think
    currentExp[attribute] = Mathf.RoundToInt(currentExp[attribute] - requiredExp[attribute]); does.
    Would it be too hard to keep currentExp and still have the progress bar empty after you level up? Because if you remove the line above the progress bar will already start at 83/174 so approx half full at level 2.

    • @NattyGameDev
      @NattyGameDev  3 года назад

      Sorry for the late reply! to do this you would need to store another variable for the "totalXp" that you have gained... and each time you level up.. you would add "currentXP" to the "totalXp" then you can use xpFraction = (currentXp +totalXp) - requiredXp; I hope that helps! I haven't had a chance to test it out in engine, but if that doesn't work then I will happily check it out for you!

    • @gxguy2906
      @gxguy2906 Год назад

      @@NattyGameDev Hi, thanks for the great tutorial. I try to implement this in one of my projects. I got the text of the currentXp not to reset each time it levels up but I having trouble trying to figure out how to reset the bar to empty after a level-up. I tried the xpFraction you provided in the comment but looks like it doesn't work for me. I know it has been a while but if possible can you check it you can help me out. Thanks.

  • @landoncarey8084
    @landoncarey8084 2 года назад +2

    I have a question. How would you make different enemies give out different exp value?

    • @NattyGameDev
      @NattyGameDev  2 года назад +1

      The way to do this would be to have a public int (or float) on our enemy script, then each time we kill an enemy we get that value from our enemy script and pass it into one of our GainExperience methods..
      That way you could change this value in the inspector.
      Usually you would do this from a script attached to the player..
      Eg: if we are finding the enemy with a raycast, then we could get that value doing something like this..
      if(hit.collider.GetComponent().health

  • @alecsongantica659
    @alecsongantica659 Год назад +2

    Hello! can someone help me? I made it to the end of the video and the level up system is working but I dont know how will I apply this to my player's enemy. (kill enemy = gain exp)
    I tried to use levelSystem.GainExperienceFlatRate(50) on the script of the enemy when he dies but it just doesnt work :((

    • @denveragaran2964
      @denveragaran2964 Год назад

      help us

    • @marriedgaming6131
      @marriedgaming6131 Год назад

      Did you end up ever figuring this out?

    • @k0ah371
      @k0ah371 Год назад +2

      I know it's kinda late but
      in your enemy script
      add LevelSystem playerLevel;
      in the start() method add playerLevel = player.GetComponent();
      in the enemy's death method of your script add playerLevel.GainExperienceFlatRate(50f);
      it works for me, good luck

  • @yasser_gg2276
    @yasser_gg2276 6 месяцев назад

    What is [Header()] 2:40

  • @Massive-3D
    @Massive-3D Год назад

    11 / 28 / 2022 the project download page seems broken. Fantastic series, sir. I watched all your videos and I know for a fact that your tutorials are the most "problem-free" available, and that they work out of the box, which is completely rare for Unity tutorials. I have a playlist of Unity Tutorials that contains 400 videos, which is not even all the videos in each series playlist. I've watched them all and I know yours are the most polished and thought out and Quality-controlled.

  • @BlackShotGames
    @BlackShotGames 2 года назад

    Hi, can you help me with something? I did the same but maxHealth and maxXP don't change when I level up, maxXP stays at 83 and maxHealth at 100.
    I don't understand English very well, did you explain anything about it in the video? I am submitting my scripts, they are not complete as they stop at 13:24 m and resolve this.
    I sent the drive link in the comment reply, RUclips should consider it as spam I think

    • @BlackShotGames
      @BlackShotGames 2 года назад

      Link: drive.google.com/file/d/1xevpVYvsQGR1lhpCfRSmL0RDmkV0Qp61/view?usp=sharing

    • @NattyGameDev
      @NattyGameDev  2 года назад +1

      I have requested access to the link :) also if you let me know your preferred language I can setup subtitles for you :)

    • @BlackShotGames
      @BlackShotGames 2 года назад

      @@NattyGameDev That's it, I fixed the link, it's still private.
      Portuguese Brazil my language, but that's ok, I think you can configure the language here

    • @NattyGameDev
      @NattyGameDev  2 года назад

      So I've tested the scripts in a new project, and everything seemed to work, which makes me think there maybe something in the setup of the scene that is causing this.
      I'll ask a few questions to better understand how its setup..
      -are you getting any errors or warnings in the console?
      -is the UI updating correctly?
      - if you put a debug message in the LevelUp() function does it get called?
      :)

    • @BlackShotGames
      @BlackShotGames 2 года назад

      The console doesn't point out any errors, only the debug is shown without problems, I believe the function is being called. But really, I think it's my project's configuration, as I noticed that no "maxCurrent" changes in it, I'll try it later with new project

  • @violanze8484
    @violanze8484 Год назад

    Maybe iam little bit stupid :D but my XP Bar will filling only if i reach level 2 befor there is nothing only the PromtText is correct. 20/83 ... and so far..

  • @BlackShotGames
    @BlackShotGames 2 года назад

    Hi me again, I managed to solve the problem, the error I made was leaving the life and XP scripts in different gameObjects, I noticed this because when I removed the line "Debug.Log(health)", the error appeared saying that the LevelUp line wasn't pulling the Healthbar, removed it temporarily worked, spent time trying to figure it out, noticed scripts needed to be in same gameObject, problem solved :) But thanks so much for the video, it saved me a lot

    • @BlackShotGames
      @BlackShotGames 2 года назад +1

      I spent the whole day looking and rescanning each line, glad it worked :V

  • @sunbleachedangel
    @sunbleachedangel 10 месяцев назад

    For some reason you made it so your maxHP increase on level up is dependant on... currentHP?? That's just weird, might just be a mistake on your part, no freaking way it is intentional

  • @TheArtist808
    @TheArtist808 2 года назад

    boss

  • @jasonzeno9056
    @jasonzeno9056 Год назад

    This worked for me on my enemies.
    GameObject.Find("Player").GetComponent().GainExperienceFlatRate(100);