Unity 2D Platformer for Complete Beginners - #7 HEALTH SYSTEM

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

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

  • @PandemoniumGameDev
    @PandemoniumGameDev  3 года назад +66

    If you're getting "The type or namespace name 'Image' could not be found" make sure to include using UnityEngine.UI (Check line 2 at 7:59 for reference)

    • @MusicFlowDaily
      @MusicFlowDaily 3 года назад +4

      You doing a great job. We as the viewers can always pause or rewind. :) The main goal is information, and you convey it perfectly.
      And oh God, the scripts, the fact that you give access to them, really saves endless hours for newbies. This makes your videos much (MUCH) more useful than all the tutorials that are without scripts.

    • @PandemoniumGameDev
      @PandemoniumGameDev  3 года назад +5

      @@MusicFlowDaily Highly appreciated, very glad I'm helping. Let me know if you have any issues.

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

      I will admit that I do find myself rewinding quite a bit, but I feel that overall the pacing is fairly good and that if somebody misses something they can simply rewind.

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

      is this some kind of sick joke

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

      @@baseddino huh?

  • @adeladam2325
    @adeladam2325 6 месяцев назад +9

    It's nice revisiting these tutorials years later to see how much I have improved. This also allows me to appreciate just how good you are. Will forever be grateful for this series.

  • @rayyandarbashi7166
    @rayyandarbashi7166 2 года назад +16

    Hey, if anybody doesn't like the collider on the saw, and you can't change it the way you want it to be because it has a box collider 2D, then you can add an "Edge Collider 2D" and then edit the collider on the saw the way you want it to be, and don't forget to put "Is Trigger" on the edge collider so it can damage your player. Oh and it's safe to remove the box collider 2D component if you're going to do this.

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

      Thanks. Didn't realise there were more colliders. There's a wheel collider at the bottom so that could be fitting for this circular saw

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

      Thanks forever

  • @lov3ly298
    @lov3ly298 2 года назад +5

    Thank you very much, man! Your help to grow future game developers is invaluable

  • @EckoTheGecko1
    @EckoTheGecko1 3 года назад +12

    Hey! loving the series so far, i've dabbled with a few other styles of games but never a platformer! Will you be continuing this series?

    • @PandemoniumGameDev
      @PandemoniumGameDev  3 года назад +5

      Yes, episode 8 will be about iFrames and 2 new types of enemies.

  • @SURESHJAT-be4km
    @SURESHJAT-be4km 10 месяцев назад

    I Lost Intrest in Unity few months ago but this tutorial is regerating my Intrest. Thank you for this best content! Love You

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

    These videos are amazing, this video series makes Unity way more manageable to grasp. I recently got into learning Swift for iOS and macOS dev, I also mess around with Arduino and the very low-level C programming language it uses, it's cool to see so many similarities in the C# code language and that keeps me motivated and hungry for more. I love your delivery, you keep a fast enough pace to keep it interesting. Thanks so much for the thoroughness in explanation! Subscribed!

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

      Thanks a lot, good luck with it and let me know if need help :)

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

    oh man, it's Zelda's health system. So cool. I love it

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

    A new Brackeys is here! Thank you!

  • @gearsbright4599
    @gearsbright4599 11 месяцев назад +1

    When recording an animation I found it useful to duplicate the last sprite. For example if the last sprite is on the 0.20 frame, then double it and set new last sprite at 0.24 frame so the duration of each sprite of an animation will be equal. Otherwise the last frame is always shorter than the rest and it results in a bit twitchy animation.

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

    Not gonna lie ..i am just watching this one...and its so cool...its just PERFECT MAN!..THANKS A TON

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

    As a 3D artist who sometimes does pixel art, I can tell you that making the animations is difficult lmao. However, this tutorial is clear cut, and very easy to follow, as well as being compatible for custom animations.

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

    If anyone has a problem with the Saw not moving, just set MovingLeft bool as true and that should be it.Btw great tutorials

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

    This video is absolutely underrated , Thanks for good tutorial

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

    Thank you very much for these courses you have done here. It makes me very eager to do projects with unity.

  • @os.a.m.a
    @os.a.m.a 3 года назад +18

    9:49
    When I open unity it says that theres a compiler error in line 7 and 8 "the type or namespace name 'Image' could not be found (are you missing a using directive or an assembly reference?)"

    • @PandemoniumGameDev
      @PandemoniumGameDev  3 года назад +8

      You need to add using UnityEngine.UI, check it out here 7:58

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

      He is not only one, who get this error. And its look like magic, unnoticeable trick, which VS can perform :(
      And sublime text are not..

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

      @@alexkrat5562 you'll get used to it in time, everytime you work with UI images, texts etc you need to include the Unity engine.UI library.

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

      @@PandemoniumGameDev thanks i had the same error

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

      @@abhisavale5231 same haha

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

    This is amazing! I used an enum to create a few different cases and with the damage and health made this awesome. I have an item that does 25 damage every time It hits the object. The object has 100 health and gets down to 0. When it gets down to 0 it should delete itself, but it does not. I have to hit it one more time for it to delete.

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

      Id love to send it to you on discord if you were up for it

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

      In this case check your if statement. I think you set are checking currentHealth

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

      @@PandemoniumGameDev yeah i figured it out! I had it set to an if the health is above zero, then an else, so then when the enemy reached zero it didnt reach the else until the next call, so i turned it into a embedded if statement and it works great! Thank you so much for these videos! The way you explain the methods and whatnot really make things click for me.

  • @biscuitbutb4106
    @biscuitbutb4106 3 месяца назад +2

    11:42 When did the Transition Structure of the Animator change? I did not see you make a transition from Any state to both Attack and Jump. You only made it for Any State to Jump initially but now out of no where it's changed.

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

    your tutorials make it simple and fun to learn unity!

  • @MaxxYT-YouTube
    @MaxxYT-YouTube 2 года назад +2

    If you want the "die" animation to look better then just add "None" sprite in the last key of die animation 😄

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

      I have added the die animation but I'm not getting in the game

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

    You could change position of saw just by adding sinus function of time to initial saw position, but your approach is also good

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

    thx a lot! i also added a weak heart that gives you a half a ordinary heart! :) :) :)

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

    such a good video, also your pacing is fine, I watch your videos on 1.5x sometimes 1.75x speed haha.

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

      I also think it's a bit slow, but hey I'm not a beginner 😁

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

    Great content. Im new to the channel, and have been following along with about one video per night. Learning a lot, hoping to learn more!

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

    Really really thanks for making these videos... It really helps in understanding the topic

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

    Thank you for making these videos! They're a lot of help

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

    Assets\scripts\Healthbar.cs(10,30): error CS0246: The type or namespace name 'Image' could not be found (are you missing a using directive or an assembly reference?)
    do i have to watch previous tutorials /:

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

      someone else had the same problem you need "using UnityEngine.UI;"

  • @robertov.dibisceglia7887
    @robertov.dibisceglia7887 3 года назад +1

    Your videos are saving my project! Really big help ; if I want to implement a second player, what are the big things I need to look out for when re-using the scripts (apart from the right tags and calling the right script names). Big fan really like your personality keep up the good work :)

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

      Thanks a million for the support!
      Well first of all you'll need to set different controls for each player(movement, attack etc).
      Other than that you need to create another UI object for the second player health, the rest of the scripts should work fine the way they are.

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

      A big help for me was:
      [SerializeField] private KeyCode left;
      this permits you to get inputs from specific keys at one time

  • @Dev.K.Patel_19-June
    @Dev.K.Patel_19-June 3 месяца назад

    guys, just a suggestion cuz i had nothing better to do:
    at 19:50, you can type transform.position += new vector3(speed * time.deltatime, 0, 0); for getting it a bit compact. same for leftMovement...

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

    If all of your sprites are also black find Global Light 2D in the hierarchy and under Light 2D in the inspector set Target Sorting Layers to 'All'. (Or just delete the Global Light 2D object entirely.)

  • @Rubiole
    @Rubiole 2 года назад +4

    I think i lost somewhere but at 11:32 i didnt have the same animations structure as you, I have idle to attack and idle to jump, can i just change the transitions as you have em there? .w.

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

      I suspect that was somthing he was working on off camera? I noticed that also, but I'm keeping mine the way we set it earlier just in case :)

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

      ​@@scorpiusjones5436same issue here
      I think i can just go on.
      God helps😂

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

    I remember you said in one spisode „you can do that if youre a massacist“ Hashshahhahs and i dobt know why its so funny for me now lol

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

    I miss the "Mission passed. Respect +1" outro. It was really rewarding.

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

    this is the most organized thing ever

  • @WaldoGamingGD
    @WaldoGamingGD 9 месяцев назад

    Keep up the great work man! As a ten year old who's been coding for ~5 years, even I was able to get through these videos with my limited attention span!

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

    Awesome, you're a champ!

  • @dkordy
    @dkordy 4 дня назад

    If it happens that at the moment when you are injured and you have the last health, if you run into a saw and you accidentally pick up a heart that happens to be nearby, the player will die but you will be given a heart. So it's a bug - and it should be fixed.

    • @dkordy
      @dkordy 4 дня назад

      And I think it would be good to add some max-health. I mean why those eight extra sprites that are hidden? unless maybe in the future you will add that there is a maxhealth?

  • @ignaciogalli343
    @ignaciogalli343 5 месяцев назад

    "I really love you, man. If someday you come to Argentina, I'll invite you to an 'Asado'."

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

    Thank you so much for this video!

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

    finally finished this point

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

    Well done tutorials. Thank you.

  • @FrosenHell
    @FrosenHell 2 года назад +4

    I've noticed in the animator you put an transition from any state to attack? when you did that? I have two transitions from idle to attack and from attack to idle. If I change the transition like yours in 11:20, will it brake the game?

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

      I have the exact same problem! And yeah it did break the game

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

      Same problem

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

      Same problem god hellllp

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

    the saw movement(sideways) worked greatly the first try, but for the next tries it doesnt move anymore. why?
    edit: I solved it, making the animation dragging the frames like you did somehow also saved the coordinates. I just hade to remake the animation the old way.

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

    I made a mistake when i changed the layering i forgot to add a layer for fire ball so they were not showing lol just a tip just incase

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

    This is an amazing tutorial! 10/10

  • @CD-fx8vk
    @CD-fx8vk 2 года назад +1

    Hey. I'm loving those unity tutorials. They are teaching me a lot. I've heard that a lot of people use Aseprite as well to help with art stuff. I've also used it to design the health bar needed in this tutorial. Do you recommend Aseprite? and what program do you use?

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

      I don't do pixel art tbh, I use Inkscape but my experience as an artist is very, very limited. I heard good things about Aseprite from good artists though, so give it a shot if you didn't already :D

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

    when did he change the transitions from idle - attack to anystate - attack? did i miss something?

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

    I have this weird thing happening where the saw is working perfectly, showing up perfectly in Scene mode, but not game mode😂 Probably something dumb I'm overlooking. And it doesn't matter what sorting layer I have on it, no show on game view.
    Thanks!

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

      Check the Z position of the saw object, it's supposed to be 0.

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

      @@PandemoniumGameDev thank god i had the same issuse right now, love the tutorials btw helping me alot

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

    Thank you my RASSIAN friend!

  • @a.giovanni.m6740
    @a.giovanni.m6740 2 года назад +1

    About the die animation, when I tried it, it plays while the Player is jumping, idle, and running, but not while hanging on a wall (wall jump).

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

    Works Great!

  • @eleven1223
    @eleven1223 5 месяцев назад +2

    I’m having trouble getting the heart to add health 😢. All the code looks exactly the same to me. Please helppp

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

    thank you for helping me from uas, glad i fnd this channel

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

    When I die my player still keeps moving while i have this in my script "GetComponent().enabled = false;"
    The player just walks in the direction of the last pressed button

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

      had this issue too but then I turned exit time to 0 and transition duration to 0 which resolved the issue for me.

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

      don't worry, that's normal because you don't have a death animation yet and "zaros3433k" (the previous reply) is probably right

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

    I have a question about the saw thing, what should I put in my code if I wanted the saw to face the direction that it is moving towards.

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

      i need the answer too XD

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

    ive got an animation for my health bar, is there a way i could just have it change to a new sprite on hit as my character will have 5 hits of health before death and ive got 5 different sprites to represent that

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

    hey im havinga problem that when i damage the player the healthbar wont update and its just stays full health even tho i already damage my character 3x already and the hurt and death animation works fine, its just the health wont decrease.

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

    17:50 hahaha I laughed so hard, I can’t wait for the next video tutorial

  • @Olat67
    @Olat67 6 месяцев назад +1

    Hi I just can’t see the hearts in the game scene can anyone help me with that everything else is fine.

    • @Olat67
      @Olat67 6 месяцев назад +1

      Never mind I fixed it 👍it’s something with the target display in the canvas I had my camera display on 2 and the target display was 1 in the canvas just changed it to target display 2 good tutorial by the way

  • @Egor-kc2dx
    @Egor-kc2dx Год назад

    Great video bro

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

    I got an error saying for the healthbar at script saying that’s there’s no image origin what do I do??

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

      at 8:02 type using unity engine .ui at the top it should fix it

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

    Hey, can you please tell me why does my character fall off forever whenever I touch any object with Box Collider 2D (is trigger ON)? PLEASE HELP

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

    Thanks for the help

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

    Great Video👍Helped me out al lot❤

  • @micahburnside2281
    @micahburnside2281 Месяц назад

    I don’t have any anchor presets icon or menu when setting the anchor

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

    Thank you so much

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

    22:12 Dont Write all what He said insted write this
    if(collision.tag == "Player")
    {
    collision.GetComponent().TakeDamag(-healvalue);

    }
    and this should work

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

      Welp, in the next video we're gonna add s when you take damage so it's gonna look like you took damage when you pick up the heart.
      Also don't forget to write gameObject.SetActive(false) otherwise you'll fill up your health infinitely

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

      @@PandemoniumGameDev look i fixed it its easy i just add a new animiton for healing
      😃

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

      @@Reham9000 Good for you, you can make it work for sure. I'm just saying that the majority of people who follow the tutorial are going to run into problems if they do that. If you're good enough to find solution then that's great, feel free to experiment and change anything!

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

    my player is not taking damage from saw ; after enabiling isTrigger on in saw; pls help me out

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

    Hello, I have a problem. After I did the steps until 10:29, a error appears. It says error CS0246: The type or namespace name "Health" could not be found (are you missing a using directive or an assembly reference?)
    And another problem is, that the 3 options under the script "Healthbar" "Player Health", "Totalhealthbar" and "Currenthealthbar" don´t show up

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

      brother use thisIf you're getting "The type or namespace name 'Image' could not be found" make sure to include
      using UnityEngine.U I (Check line 2 at 7:59 for reference) it may help you

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

      Did you ever find an answer to this? Facing this issue now.

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

    Great Tutorial
    Thanks for taking your time making this videos.
    How can i get it to respawn with full hearts each time the player dies?

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

    Great tutorial ! how would you go for making the Saw moving up and down ? I've tried copying the scripts logic and changing the transform.position.y, but the saw went up and never came back -_-. What am I missing ?

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

    Hey ive got a problem after the Healthbar script: Assets\C#\Health\Healthbar.cs(12,50): error CS1061: 'HealthBar' does not contain a definition for 'currentHealth' and no accessible extension method 'currentHealth' accepting a first argument of type 'HealthBar' could be found (are you missing a using directive or an assembly reference?)
    please help

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

      Did you find the fix as ive got the same error?

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

    Will the enemies walk around and try to shoot back? And maybe you can add a visible hp bar above the enemy so player can kill the enemy (or boss fight). And i noticed that camera doesnt follow the player if he goes up (by wall climbing), so maybe you can add that somehow? Great videos btw, cant wait for the next part!!

    • @PandemoniumGameDev
      @PandemoniumGameDev  3 года назад +4

      Will def add enemies with healthbars. The camera doesn't go up on purpose, otherwise you'd see the black background. I'll keep the camera in the center of the room for this game, like in the Binding of Isaac.

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

      @@PandemoniumGameDev Thanks for answer!

  • @ninjakiwigames5418
    @ninjakiwigames5418 15 дней назад +1

    A reminder if the health bar doesn't work for you: Link the scripts to your player!

    • @ninjakiwigames5418
      @ninjakiwigames5418 15 дней назад

      And then link things to the script (images, health)

  • @Swap-511.0
    @Swap-511.0 3 месяца назад

    my die animation doesnt work I did everything you do but it doesnt trigger the animation

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

    So how would I be able to make a health bar without the filler tool, specifically using different images every time I take damage

  • @merableamber
    @merableamber Месяц назад

    Health.cs(16,17):error CS0111: Type 'Health' already defines a member called 'TakeDamage' with the same parameter types
    Health.cs(10,18):error CS0111: Type 'Health' already defines a member called 'Awake' with the same parameter types
    I'm struggling with this an I don't know what to do about it, please help🙏

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

    in the script, what was the image private? I tried to do it and it said the the namespace couldn't be found

  • @error-hz8qc
    @error-hz8qc 2 года назад +1

    whenever i take damage from trap, my game stops and throws me this error
    NullReferenceException: Object reference not set to an instance of an object
    Health.TakeDamage (System.Single _damge) (at Assets/Scripts/Health.cs:25)
    Trap.OnTriggerEnter2D (UnityEngine.Collider2D collision) (at Assets/Scripts/Trap.cs:12)

    • @error-hz8qc
      @error-hz8qc 2 года назад +1

      I just made Animator public from private in Health script and somehow it worked!! IDK what happened ? Could you explain me ??

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

      i have the same problem wdym you set animator to public how did u do that

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

    If i also have jump animation which is also transit from any state, it wont trigger hurt animation during jumping animation. Any idea how to fix that?

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

    after using the {get; private set;} it says healthbar does not contain a def for 'currentHealth' and no accessible extension method 'currentHealth' accepting a first argument of type 'Healthbar' could be found
    any reason why this could be happening?

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

    Hello, thank you for awesome content you helping some of us who are absolute beginners, the pacing is abit fast but I am still managing by pausing and rewinding. Your explanations are really good so thank you. I have a issue where I jump and my player sometimes get stuck in the air and theres nothing but the background. Can you please assist.

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

    In the healthbar script "Image" is giving me an error as it could not be found

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

    Hello, i want to ask why did the saw disappear on game but it's appear on scene, it became invisible deadly trap

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

    I wonder if "if statement" neglect boolean condition for once when the game start although we didn't assign any value to them.(eg.bool dead in player's Health script and bool movingLeft in saw's Sideways script.)
    Btw, thanks a million for the tutorials.Hope u having an amazing day!

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

      Ultra late reply, sorry. If you don't specifically assign a value to a bool variable it's gonna be false when you start the game. The same with numbers, they're gonna be 0.

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

      @@PandemoniumGameDev thanks , appreciate it

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

    Great Video :D

  • @ShadowCraft1118
    @ShadowCraft1118 29 дней назад

    my health bar aint taking damage can someone please help me ive tried everything

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

    At 10.26 when I start my health bar starts of black and I press E and nothing happens but I’m not sure what I did wrong

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

    Thanks!

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

    some one please help i get an error with the hurt and die animation it says object referance not set to an instance of an object for 3 lines of code
    1: anim.GetComponent();
    2: anim.SetTrigger("hurt");
    3: anim.SetTrigger("die");
    im almost having to give up on the project because i cant find out what is wrong also i made sure that the hurt and die animations are spelt the same in the animator window and my code

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

      2 months gone by and im still stuck on this error

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

      omg fixed it under private void awake i put anim.GetComponent(); instead of anim = GetComponent(); idk weather to be sad or happy rn

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

    I got a new problem haha, i got an error that says that 'image' does not contain a definition for 'fillAmount' and no accesible extension method 'fillAmount' accepting a first argument of type 'image' could be found.

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

    so when i downloaded this project and open and played in unity fireballs weren't working it just showed some animation

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

    I don't know if anyone will see this but I really need help right now. How to set the health bar to stay within the visible area of the game screen, even when the player character moves close to the edges of the scene? Since in previous video I use the camera follow movement one instead so now the healthbar is kinda stuck with the camera movement. Which leading to the healthbar to get out of frame when the character moves too close to the edges. (I'm sorry in advance since eng is not my first language)

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

      in canvas object go to canvas scaler and set scale with screen size

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

    i did everything that you did and in the final, when i try to pickup the heart, he don't dissapear..

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

    My Healthbar script, has an error, It shows error C0246: Type or namespace name "image" could not be found

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

    Something is wrong with the script whenever I am trying to make an enemy to do damage to me it doesn't work.

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

    thanks alots ❤️

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

    i spawn my player in at the start how would i go about setting up a health system for that? I'm going to find the answer surely, but maybe someone who is having the same issue could see this and get an quick answer in the future.

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

    Hey! Why do you make SerializerField private, shouldn't they be public? Also, in your real projects do you prefix private variables with the underscore "_"? And thanks for the tutorial!

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

      1. SerializeField is used to make variables visible in the inspector, but public variables already are visible in the inspector, so there's actually no point to use SerializeField with public variables.
      2. I only use _ for parameter variables inside methods like `private void Calculate(_number)` but that's just a personal preference, go with what you like most. The only rule that I found more people tend to follow is to use lowercase letters for variables and uppercase for functions, other than that everyone does what they like :D

  • @madd-cat
    @madd-cat 3 года назад +1

    how about player respawn code?