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

Поділитися
Вставка
  • Опубліковано 25 лис 2024
  • 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.c...
    Runescape Level Scaling Wiki
    oldschool.rune...
    Coding With Unity: Unity3D - Level Scaling for beginners
    • Unity3D - Level Scalin...
    Thanks for Watching!

КОМЕНТАРІ • 51

  • @helicopterkat1697
    @helicopterkat1697 Рік тому +5

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

  • @theillestones1350
    @theillestones1350 Рік тому +2

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

  • @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

  • @MarkayCS
    @MarkayCS 2 роки тому

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

  • @dctzeng
    @dctzeng Рік тому

    Thanks you for your selfless and generous sharing

  • @chaineprogrammation7797
    @chaineprogrammation7797 Рік тому

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

  • @tagscientist
    @tagscientist 3 роки тому +1

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

  • @Noir-Road
    @Noir-Road 2 роки тому

    BullsEye !
    This is exactly what I need. Cheers !

  • @산뜻에어
    @산뜻에어 2 роки тому

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

  • @Ma_cieK
    @Ma_cieK 2 роки тому

    This is awsome bro. Great work !

  • @RazorianBuck
    @RazorianBuck 3 роки тому +3

    Your tutorials are really good.

  • @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.

  • @brianjensen2532
    @brianjensen2532 3 роки тому +1

    AnimationCurve would work too. Nice visualization though.

  • @saraschroder7523
    @saraschroder7523 2 роки тому

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

    • @saraschroder7523
      @saraschroder7523 2 роки тому

      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! :)

  • @Astrobot01
    @Astrobot01 3 роки тому +1

    Very Good Tutorial

  • @Geckotr
    @Geckotr Рік тому

    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

  • @weebaki2994
    @weebaki2994 3 роки тому

    Thank you ,great tutorial :D

  • @ayehavgunne
    @ayehavgunne 3 роки тому +1

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

  • @priyamvadasharma26
    @priyamvadasharma26 2 роки тому

    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.

  • @gencerger539
    @gencerger539 3 місяці тому

    Thank you soo much.

  • @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.

    • @slothisgaming2584
      @slothisgaming2584 2 місяці тому

      I know it's a bit late but I found the solution. Go to your Canvas -- select Canvas scaler and then change from constant pixel to scale with screen size and then change your resolution to the size you want it to be

  • @landoncarey8084
    @landoncarey8084 3 роки тому +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 роки тому +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 2 роки тому

      help us

    • @marriedgaming6131
      @marriedgaming6131 2 роки тому

      Did you end up ever figuring this out?

    • @k0ah371
      @k0ah371 2 роки тому +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

  • @dariuszwesierski1928
    @dariuszwesierski1928 Рік тому

    Thx man!

  • @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.

  • @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

  • @Massive-3D
    @Massive-3D 2 роки тому

    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.

  • @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..

  • @sunbleachedangel
    @sunbleachedangel Рік тому

    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

  • @tredutore
    @tredutore Рік тому

    nice

  • @yasser_gg2276
    @yasser_gg2276 11 місяців тому

    What is [Header()] 2:40

  • @inquisitive240
    @inquisitive240 Рік тому

    GOAT LEGENT

  • @faustoyoshihara6747
    @faustoyoshihara6747 Рік тому

    Uau, thx Man

  • @BlackShotGames
    @BlackShotGames 3 роки тому

    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, UA-cam should consider it as spam I think

    • @BlackShotGames
      @BlackShotGames 3 роки тому

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

    • @NattyGameDev
      @NattyGameDev  3 роки тому +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 3 роки тому

      @@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  3 роки тому

      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 3 роки тому

      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

  • @BlackShotGames
    @BlackShotGames 3 роки тому

    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 3 роки тому +1

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

  • @TheArtist808
    @TheArtist808 3 роки тому

    boss

  • @jasonzeno9056
    @jasonzeno9056 Рік тому

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