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!
this is two years old but you just fixed everything thank you so much
Good tutorial. One thing to keep in mind when doing xp leveling systems, is that animation curves go a long ways!
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
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!
Thanks you for your selfless and generous sharing
Un grand merci depuis la France.
Thanks !! 👍👍
Excellent stuff, thank you. You are a very clear speaker - I look forward to more of your tutorials.
BullsEye !
This is exactly what I need. Cheers !
Thanks a lot for your tutorials and your voice is charming !! have a good day
This is awsome bro. Great work !
Your tutorials are really good.
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.
AnimationCurve would work too. Nice visualization though.
Watched so many tutorials that didn't work before I found this one! Amazing! Thank you :)
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! :)
Very Good Tutorial
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
Thank you ,great tutorial :D
Every time you say fillAmount I hear ‘fill em out’
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.
Thank you soo much.
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.
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
I have a question. How would you make different enemies give out different exp value?
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
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 :((
help us
Did you end up ever figuring this out?
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
Thx man!
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.
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!
@@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.
hi, i've tried the same but when i play, the bar is always 100% for whatever the fraction is ( 0
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.
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..
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
nice
What is [Header()] 2:40
GOAT LEGENT
Uau, thx Man
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
Link: drive.google.com/file/d/1xevpVYvsQGR1lhpCfRSmL0RDmkV0Qp61/view?usp=sharing
I have requested access to the link :) also if you let me know your preferred language I can setup subtitles for you :)
@@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
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?
:)
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
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
I spent the whole day looking and rescanning each line, glad it worked :V
boss
This worked for me on my enemies.
GameObject.Find("Player").GetComponent().GainExperienceFlatRate(100);