Level Up with Experience Points in Unity

Поделиться
HTML-код
  • Опубликовано: 1 янв 2025

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

  • @matthewmiller4633
    @matthewmiller4633 6 месяцев назад +3

    What I love about your channel is that you explain the same things that everyone else is, but you are following the "Explain Like I'm Five" methodology, which is absolutely what I need. Thank you for making these concepts super understandable!!

  • @qwasd0r
    @qwasd0r 3 месяца назад +1

    Didn't sign up for the event system tutorial, but I'm thankful for it. Great stuff!

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

    This was super helpful!
    If you feel so inclined ;) implementing some kind of Level Up mechanic for implementing a skill tree in a "series" style of video would be great.

  • @eatmorvegetal3444
    @eatmorvegetal3444 Год назад +5

    Not gonna lie, I kinda gave up on learning C# and Unity for the moment, but whenever I decide to get back to it, your channel is going to be a main resource.

    • @jumpshot353
      @jumpshot353 4 месяца назад +1

      have you got back to learning?

  • @mike_b10
    @mike_b10 Год назад +3

    dude you are a gem

  • @eileeng2492
    @eileeng2492 Год назад +3

    So useful , great, thank you

  • @ssbmPi
    @ssbmPi 11 месяцев назад

    Just found your videos, I like your pacing and how you structure your videos so thank you :). Currently watching your scriptable objects (referencing Fine/Hipple talks) and am now watching this video. I'm going to try and implement this system while using scriptable objects. If you were so inclined maybe a followup video to this one changing it to use ScriptableObjects as well. I'm sure I'll be able to meld the two together but any further insight/examples are always appreciated. Perhaps scriptable objects for events
    Thanks again

  • @sergiosg5039
    @sergiosg5039 2 месяца назад

    me voy a suscribir a tu canal, tus videos son en verdad buenos

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

    Very concise. Thank you!

  • @Uplatenerd
    @Uplatenerd Год назад +6

    How do you address the issue if you save the project, you get an error of NullReferenceException: Object reference not set to an instance of an object
    PlayerHealth.OnEnable () (at Assets/Scripts/PlayerHealth.cs:16)
    . Everything works fine until you save and restart it.

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

      Does everything break? Or just the exp?

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

      Since i am having the same issue, i need to know if you have the answer

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

      @@gamingprochampion5822 let me know if you ever figure out what is wrong

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

      Remember to put the ExperienceManager script to an object in the scene besides the character (its best to create an object only with this script attached to it)

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

      Did you ever find a fix for this?

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

    So weird seeing Isaac smile

  • @ftrwar
    @ftrwar 7 дней назад

    this is awsome

  • @SomnusShinra
    @SomnusShinra 8 месяцев назад +1

    How did you setup the XP Progress bar at the start of the video? How do you make it?

    • @ShadowCraft1118
      @ShadowCraft1118 3 месяца назад

      i think you make a slider object in the ui canvas and set it to be equal to the current experience through an update method.

  • @go6ko1
    @go6ko1 Год назад +4

    If you are getting "NullReferenceException: Object reference not set to an instance of an object", and you've followed the tutorial to the point - one solution would be to go into Edit > Project Settings > Script Execution Order and add both scripts Experience Manager (ex value: 100) and Character (ex value: 200). This will make the Experience Manager run first, and Character second.
    The issue comes from the difference in execution times/order between Awake methods and OnEnable methods.

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

      This shouldn't happen since Awake is called before OnEnable, so if that's happening, there could be some other problem in the code/setup. Generally, you shouldn't resort to changing the script execution order.

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

      You can fix this error without manipuliating the execution order(I also recommend it because changing it can lead to funny errors). This error usally happens when you have an Awake() function somewhere in your code that requires and Object/Prefab that uses the ExpereinceManager methods, because the OnEnable() method is executed after the Awake() function so it requires the object before it is enabled leading to the null Reference Exception. So in short.... Dont use Awake() when possible always use Start()

    • @TT-yl1gz
      @TT-yl1gz Год назад

      You should use Invoke() to delay the OnEnable and OnDisable for 0.2 seconds

    • @HyperWook
      @HyperWook 4 месяца назад

      I checked for Awake in every script i have and tried every other fix and nothing worked except doing what you reccomended. i would reccomend any else having problems to try what @Charybdis47 is saying and pretty much replace all awakes except for the experienceManager and if that doesnt work try editing the script execution order. This is very last resort, and I spent hours before resorting to this.

  • @artZs-chaos
    @artZs-chaos Год назад +1

    Really amazing Tutorials! Can you make one all about like coins and shop systems.

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

    Can you show a tutorial for the ui in the intro?

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

    Can I have it as a child object that empty object which detects collecting exp in case that I do rpg? So when I am far away so it accidentally doesn’t stop count or when I leave the scene so it keeps the values from previous level and so on. Or I have to always create a new empty object containing this exp manager script

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

    For some reason, all of the code worked at first, but when i closed and reopened my project, all the experience gain just stopped working. The hp all worked fine, but the exp gain was not working. Does anyone know the solution to this?

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

      Have you checked if you have any other EventSystem or maybe anything disabling your gameObject tha has the Character.cs script?

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

      This error usally happens when you have an Awake() function somewhere in your code that requires and Object/Prefab that uses the ExpereinceManager methods, because the OnEnable() method is executed after the Awake() function so it requires the object before it is enabled leading to the null Reference Exception. So in short.... Dont use Awake() when possible always use Start()

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

    If you have this Error:*NullReferenceException: Object reference not set to an instance of an object* Follow this: You can fix this error without manipuliating the execution order(I also recommend it because changing it can lead to funny errors). This error usally happens when you have an Awake() function somewhere in your code that requires and Object/Prefab that uses the ExpereinceManager methods, because the OnEnable() method is executed after the Awake() function so it requires the object before it is enabled leading to the null Reference Exception. So in short.... Dont use Awake() when possible always use Start()

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

      still doesn't work for me
      any other ideas?

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

      ​@@hazen7645 it seems you have misunderstood my comment. I am not talking about the awake function from the experience manager class, but another class that may use the events that this function enables. Then it triggers an error like this, because it tries to acess the Manager which hasnt been enabled yet with OnEnable(). Thats why I suggested to only use Awake() when truly necessary which is almost never. I didnt suggest to not use Awake() in the ExperieninceManager. All you do is confuse people who got this error like me. Just look at the comments....

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

      @@hazen7645 listen buddy I dont know why you try to start an argument even tho I explained it 2 times already but here we go again..... You have the player class which has OnEnable() and OnDisable() which subscribe or unsubscribe to the ExerienceManager method. This player object can be called at the start of the game to spawn on 1 or more player prefabs that have this script attached. When you work with a bad codebase LIKE I DID, in the spawnScript there was an Awake() function which instantiated a player prefab which couldnt call the OnEnable() method ,because Awake() triggered it to early, causing a NullReferenceException. THEREFORE I said dont use Awake() only when you dont have to cause it can cause funny Errors like that. It has NOTHING to do with the Awake() method in ExperienceManager class. Will you say I dont understand this again yes??

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

      @@hazen7645 i literally said:"error usually happens when you have an Awake() function somwhere in your code that requires and Object/prefab that uses the ExperienceManager methods" bro learn to read before you write instead of accusing me of being stupid💀

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

    NullReferenceException: Object reference not set to an instance of an object

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

      You can fix this error without manipuliating the execution order(I also recommend it because changing it can lead to funny errors). This error usally happens when you have an Awake() function somewhere in your code that requires and Object/Prefab that uses the ExpereinceManager methods, because the OnEnable() method is executed after the Awake() function so it requires the object before it is enabled leading to the null Reference Exception. So in short.... Dont use Awake() when possible always use Start()

    • @ĐôTrầntrọng-i7j
      @ĐôTrầntrọng-i7j 9 месяцев назад

      @@Charybdis47 What does that mean? I don't get it

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

      I have the same issue, I just made the OnExperienceChange event static in the ExperienceManager class and it works. hope it helps

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

      @@yensi1994 how did you do that? I tried that as well but then I get another error

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

    It all worked until i reloaded, at which point the exp gain stopped working. how do i fix this?

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

      You can fix this error without manipuliating the execution order(I also recommend it because changing it can lead to funny errors). This error usally happens when you have an Awake() function somewhere in your code that requires and Object/Prefab that uses the ExpereinceManager methods, because the OnEnable() method is executed after the Awake() function so it requires the object before it is enabled leading to the null Reference Exception. So in short.... Dont use Awake() when possible always use Start()

  • @twinguy9633
    @twinguy9633 10 месяцев назад +2

    You could have explained the stuff in more detail...

  • @mandamoon9149
    @mandamoon9149 Год назад +16

    I will unsubscribe from the event but never from this channel

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

    I will add this

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

    This was hot

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

    Outro tune is a jam

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

    perfect,

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

    Pog

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

    NullReferenceException: Object reference not set to an instance of an object

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

      It signals that you haven't put the object in unity that you want to reference in the script