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

  Рет қаралды 116,087

Pandemonium

Pandemonium

Күн бұрын

In this episode we'll create a health system. We will add health to our player, create a health bar, make a deadly saw trap that can damage the player and health collectibles to restore your health.
➤ Download the heart sprites: drive.google.com/drive/folder...
➤ Starting Project: github.com/nickbota/Unity-Pla...
➤ Complete Project: github.com/nickbota/Unity-Pla...
Subscribe and turn on the notifications if you don't want to miss the fourth episode!
➤ Discord : / discord
➤ Patreon: / pandemonium_games
➤ Instagram: / pandemonium_games
➤ Twitter: / pandemoniumnick​
➤ Itch: nickbota.itch.io/​
#pandemonium​ #unity2dplatformer​ #unitybeginner​
Tags: Unity 2D Platformer for Complete Beginners,Unity 2D Platformer episode 7,Platformer for Complete Beginners,unity platformer complete beginner,unity2d,unity 2d game tutorial,unity beginner tutorial,pandemonium games,game development for beginners,unity platformer,Unity 2D Platformer for Complete Beginners - #7 HEALTH SYSTEM,unity health system,unity health,unity3d,unity damage system,unity traps,unity enemy,unity health pickup,unity 2d platformer,health system
0:00​ Intro
0:11 Prefab Fireballs
2:15 Sorting Layers
3:35 Health Component
5:00 Health UI
7:43 Making the healthbar work
10:33 Hurt & Die Animations
14:20 Creating a Saw Trap
20:23 Health Pickups
22:50 Outro

Пікірлер: 385
@adeladam2325
@adeladam2325 2 ай бұрын
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.
@lov3ly298
@lov3ly298 2 жыл бұрын
Thank you very much, man! Your help to grow future game developers is invaluable
@PandemoniumGameDev
@PandemoniumGameDev 2 жыл бұрын
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 2 жыл бұрын
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 2 жыл бұрын
@@MusicFlowDaily Highly appreciated, very glad I'm helping. Let me know if you have any issues.
@quotes612
@quotes612 2 жыл бұрын
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?
@renderartist
@renderartist 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 жыл бұрын
Thanks a lot, good luck with it and let me know if need help :)
@SURESHJAT-be4km
@SURESHJAT-be4km 6 ай бұрын
I Lost Intrest in Unity few months ago but this tutorial is regerating my Intrest. Thank you for this best content! Love You
@fkingb
@fkingb 2 жыл бұрын
This video is absolutely underrated , Thanks for good tutorial
@erayogunozdemir8983
@erayogunozdemir8983 Жыл бұрын
Thank you very much for these courses you have done here. It makes me very eager to do projects with unity.
@hahaeggplanet12
@hahaeggplanet12 2 жыл бұрын
your tutorials make it simple and fun to learn unity!
@Call_Ada
@Call_Ada Жыл бұрын
A new Brackeys is here! Thank you!
@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!
@achrafloudiy456
@achrafloudiy456 Жыл бұрын
Many thanks for this series. It helped me a lot!
@Geckotr
@Geckotr 2 жыл бұрын
oh man, it's Zelda's health system. So cool. I love it
@emiljordan8949
@emiljordan8949 2 жыл бұрын
Thank you for making these videos! They're a lot of help
@hopedopr5550
@hopedopr5550 2 жыл бұрын
Really really thanks for making these videos... It really helps in understanding the topic
@EckoTheGecko1
@EckoTheGecko1 2 жыл бұрын
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 2 жыл бұрын
Yes, episode 8 will be about iFrames and 2 new types of enemies.
@yugbhagat6531
@yugbhagat6531 2 жыл бұрын
Not gonna lie ..i am just watching this one...and its so cool...its just PERFECT MAN!..THANKS A TON
@rayyandarbashi7166
@rayyandarbashi7166 2 жыл бұрын
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 Жыл бұрын
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 Жыл бұрын
Thanks forever
@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.
@AchimTheEagle
@AchimTheEagle 7 ай бұрын
This is an amazing tutorial! 10/10
@strahinja1910
@strahinja1910 Жыл бұрын
If anyone has a problem with the Saw not moving, just set MovingLeft bool as true and that should be it.Btw great tutorials
@Cleevor
@Cleevor 2 жыл бұрын
this is the most organized thing ever
@olexayko
@olexayko 9 ай бұрын
You could change position of saw just by adding sinus function of time to initial saw position, but your approach is also good
@gearsbright4599
@gearsbright4599 6 ай бұрын
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.
@globes179
@globes179 Жыл бұрын
Awesome, you're a champ!
@matejkunstelj7852
@matejkunstelj7852 Жыл бұрын
thx a lot! i also added a weak heart that gives you a half a ordinary heart! :) :) :)
@robertov.dibisceglia7887
@robertov.dibisceglia7887 2 жыл бұрын
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 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 жыл бұрын
A big help for me was: [SerializeField] private KeyCode left; this permits you to get inputs from specific keys at one time
@cleangaminganalysis8651
@cleangaminganalysis8651 2 жыл бұрын
finally finished this point
@calvinbirch7547
@calvinbirch7547 2 жыл бұрын
Works Great!
@CD-fx8vk
@CD-fx8vk 2 жыл бұрын
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
@X_Daniel466
@X_Daniel466 Жыл бұрын
Well done tutorials. Thank you.
@PandemoniumGameDev
@PandemoniumGameDev Жыл бұрын
Glad it was useful, thanks for watching them!
@rttracy
@rttracy 2 жыл бұрын
such a good video, also your pacing is fine, I watch your videos on 1.5x sometimes 1.75x speed haha.
@PandemoniumGameDev
@PandemoniumGameDev 2 жыл бұрын
I also think it's a bit slow, but hey I'm not a beginner 😁
@Rejgam756
@Rejgam756 2 жыл бұрын
I miss the "Mission passed. Respect +1" outro. It was really rewarding.
@PandemoniumGameDev
@PandemoniumGameDev 2 жыл бұрын
Gotta bring it back for future videos
@Egor-kc2dx
@Egor-kc2dx Жыл бұрын
Great video bro
@linussustips3636
@linussustips3636 2 жыл бұрын
Great Video👍Helped me out al lot❤
@hollowclock9948
@hollowclock9948 2 жыл бұрын
Thanks for the help
@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 ?
@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?
@the1sanash
@the1sanash 2 жыл бұрын
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
@a.giovanni.m6740
@a.giovanni.m6740 Жыл бұрын
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).
@rizalaldiansyah1961
@rizalaldiansyah1961 Жыл бұрын
thank you for helping me from uas, glad i fnd this channel
@PandemoniumGameDev
@PandemoniumGameDev Жыл бұрын
Glad you found it too! Good luck learning
@ignaciogalli343
@ignaciogalli343 Ай бұрын
"I really love you, man. If someday you come to Argentina, I'll invite you to an 'Asado'."
@PandemoniumGameDev
@PandemoniumGameDev Ай бұрын
Best thing I heard in a while, thank you!
@TheGreatProphecy
@TheGreatProphecy Жыл бұрын
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 Жыл бұрын
Id love to send it to you on discord if you were up for it
@PandemoniumGameDev
@PandemoniumGameDev Жыл бұрын
In this case check your if statement. I think you set are checking currentHealth
@TheGreatProphecy
@TheGreatProphecy Жыл бұрын
@@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.
@PitouBruh
@PitouBruh 8 ай бұрын
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?
@alcoop8729
@alcoop8729 2 жыл бұрын
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
@MaxxYT-YouTube
@MaxxYT-YouTube Жыл бұрын
If you want the "die" animation to look better then just add "None" sprite in the last key of die animation 😄
@varshas296
@varshas296 10 ай бұрын
I have added the die animation but I'm not getting in the game
@mashanikolaeva3030
@mashanikolaeva3030 2 жыл бұрын
Thank you so much
@WaldoGamingGD
@WaldoGamingGD 5 ай бұрын
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!
@ADEEGANTENGG
@ADEEGANTENGG 2 жыл бұрын
Thanks!
@wadetwynham4734
@wadetwynham4734 2 жыл бұрын
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.
@wholesomez4967
@wholesomez4967 2 жыл бұрын
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.
@alakaspoon1458
@alakaspoon1458 Жыл бұрын
I was following your tutorial, and an issue that came up was that the player was not taking damage from the saw and wasn't interacting with the line of sight mechanism for the melee enemy. Would u a solution to fix this?
@chrisu2004
@chrisu2004 2 жыл бұрын
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 2 жыл бұрын
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.
@chrisu2004
@chrisu2004 2 жыл бұрын
@@PandemoniumGameDev Thanks for answer!
@FrosenHell
@FrosenHell 2 жыл бұрын
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 8 ай бұрын
I have the exact same problem! And yeah it did break the game
@cricketo2001
@cricketo2001 5 ай бұрын
Same problem
@strong3073
@strong3073 3 ай бұрын
Same problem god hellllp
@capooey1227
@capooey1227 9 ай бұрын
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?
@triplea7260
@triplea7260 2 жыл бұрын
thanks alots ❤️
@piriyasakpaopao2549
@piriyasakpaopao2549 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 Жыл бұрын
i need the answer too XD
@Geckotr
@Geckotr 2 жыл бұрын
Error CS0246 The type or namespace name 'Image' could not be found (are you missing a using directive or an assembly reference?) i get this error in the Healthbar script. Can't find the reason
@Geckotr
@Geckotr 2 жыл бұрын
ok i found the problem. i didn't add the UnityEngine.UI line on top
@rvens8885
@rvens8885 2 жыл бұрын
@@Geckotr Thank you!! I missed that detail as well
@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
@StigDesign
@StigDesign 2 жыл бұрын
Great Video :D
@PandemoniumGameDev
@PandemoniumGameDev 2 жыл бұрын
Thanks Stig 🥳
@ryod8774
@ryod8774 Жыл бұрын
in the script, what was the image private? I tried to do it and it said the the namespace couldn't be found
@Dark_3333
@Dark_3333 Жыл бұрын
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.
@Squees
@Squees 11 ай бұрын
I got an error saying for the healthbar at script saying that’s there’s no image origin what do I do??
@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.
@kuroehe6454
@kuroehe6454 9 ай бұрын
Hello, i want to ask why did the saw disappear on game but it's appear on scene, it became invisible deadly trap
@lorenzoboiko
@lorenzoboiko 2 жыл бұрын
17:50 hahaha I laughed so hard, I can’t wait for the next video tutorial
@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.)
@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
@issak1320
@issak1320 10 ай бұрын
i did everything that you did and in the final, when i try to pickup the heart, he don't dissapear..
@l1kr1k37
@l1kr1k37 Жыл бұрын
how did you make those hearts perfectly fit in unity slider values??? i was trying to make my own tiles for health, but it didnt worked properly
@l1kr1k37
@l1kr1k37 Жыл бұрын
nevermind, just solve it, but the video is still so good, my case was just a bit different
@nursyarima4252
@nursyarima4252 13 күн бұрын
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)
@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 жыл бұрын
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
@Worlfable
@Worlfable Жыл бұрын
Thank you my RASSIAN friend!
@PandemoniumGameDev
@PandemoniumGameDev Жыл бұрын
😂I'm not russian, although I'm very glad to help!
@Rubiole
@Rubiole Жыл бұрын
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 3 ай бұрын
​@@scorpiusjones5436same issue here I think i can just go on. God helps😂
@gustas1325
@gustas1325 Жыл бұрын
My Healthbar script, has an error, It shows error C0246: Type or namespace name "image" could not be found
@APFreakwiz
@APFreakwiz 4 ай бұрын
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.
@dead465joe
@dead465joe Жыл бұрын
This tutorial is great! I seem to have run into an issue however, where the UI images aren’t appearing in the game, they appear in the game view but not the actual game. I’ve tried checking and changing the Z value but it doesn’t seem to make a difference. Any chance anything knows the issue?
@PandemoniumGameDev
@PandemoniumGameDev Жыл бұрын
Let's try this: 1. Is the canvas object set to Screen Space - Overlay? 2. Is the Healthbar holder object's Z position 0? 3. Is the Healthbar image Z position 0? That's the only thing that comes to mind. Sometimes Unity does have glitches and stops showing images, but a restart should've solved it in this case.
@dead465joe
@dead465joe Жыл бұрын
@@PandemoniumGameDev I've checked these things and attempted to restart, but it seems i have different issue. I will try recreating the UI altogether and see if that makes a difference. Thank you either way Edit: I’m an idiot, I didn’t add a value for starting health. Sorry for that
@GAMINGWITHNEONyt
@GAMINGWITHNEONyt Жыл бұрын
my player is not taking damage from saw ; after enabiling isTrigger on in saw; pls help me out
@brainy3429
@brainy3429 2 жыл бұрын
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 жыл бұрын
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
@soyuzistrepublic9771
@soyuzistrepublic9771 Жыл бұрын
It keeps saying 'tyoe or namespace name 'Health' could not be found. What does this mean? What do I need to do?
@baseddino
@baseddino 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;"
@frewenyap2178
@frewenyap2178 2 жыл бұрын
Where can i find it
@os.a.m.a
@os.a.m.a 2 жыл бұрын
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 2 жыл бұрын
You need to add using UnityEngine.UI, check it out here 7:58
@alexkrat5562
@alexkrat5562 2 жыл бұрын
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 2 жыл бұрын
@@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 жыл бұрын
@@abhisavale5231 same haha
@yaokabanzai158
@yaokabanzai158 Ай бұрын
привет! у меня немного другой скрипт..и когда я добавил ваш у моего персонажа проигрывается анимация смерти, но он просто начинает перемещаться в бок..в чем может быть проблема?
@insane6782
@insane6782 2 жыл бұрын
so when i downloaded this project and open and played in unity fireballs weren't working it just showed some animation
@juneha
@juneha 2 жыл бұрын
Will you explain how to respawn after health is 0?
@afence3642
@afence3642 Жыл бұрын
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?
@sLex_LP435
@sLex_LP435 2 жыл бұрын
Hey first off all nice Video :), i have a Probleme everything works fine by me but my hearts are not showing ingame but they are there i can take them and get life back but i cant see them i gave them the layer foreground in the Game scene i can see them but when i start the game there are invisible ? maybe have an idea ? :D
@cbacon4646
@cbacon4646 2 жыл бұрын
Did you accidentally set the UI Z position behind everything else? If you have two items on the same layer but one is physically behind the other, it won’t render. It’s also possible your layering is messed up.
@PandemoniumGameDev
@PandemoniumGameDev 2 жыл бұрын
It's probably the Z position if you're talking about collectibles, make sure to put it at 0. If that's not the case DM me more details on Discord.
@sLex_LP435
@sLex_LP435 2 жыл бұрын
@@PandemoniumGameDev Thx ur right
@Hubxrt
@Hubxrt Жыл бұрын
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
@harald_harry5196
@harald_harry5196 Жыл бұрын
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.
@osamafreed4816
@osamafreed4816 10 ай бұрын
The type or namespace name 'Health' could not be found (are you missing a using directive or an assembly reference?) ????????????????/
@PandemoniumGameDev
@PandemoniumGameDev 10 ай бұрын
Did you call the Health script exactly like that? This error usually pops up when you change the names of the script or just call it differently from the start.
@kieranryan7625
@kieranryan7625 2 жыл бұрын
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 жыл бұрын
Check the Z position of the saw object, it's supposed to be 0.
@linkg5399
@linkg5399 Жыл бұрын
@@PandemoniumGameDev thank god i had the same issuse right now, love the tutorials btw helping me alot
@pegahkhademi2214
@pegahkhademi2214 Жыл бұрын
Thanks for the great tutorial. The saw does not move for me I even set movingLeft true at the beginning of the code. Is there anything else that I should check? (The the speed and MovementDistance are not zero)
@PandemoniumGameDev
@PandemoniumGameDev Жыл бұрын
Are you getting any errors in the console? And is the speed set to 0 or smth higher?
@pegahkhademi2214
@pegahkhademi2214 Жыл бұрын
@@PandemoniumGameDev there Is just a "NullRefrenceException :Object reference not set to an instance of an object" And The speed is 5.
@PandemoniumGameDev
@PandemoniumGameDev Жыл бұрын
@@pegahkhademi2214 The null reference is the issue. What script is it related to? It would be easier if you DM me on Discord btw
@pegahkhademi2214
@pegahkhademi2214 Жыл бұрын
@@PandemoniumGameDev thanks a lot for answering. I will DM you.
@phillipquigley6143
@phillipquigley6143 7 күн бұрын
Something is wrong with the script whenever I am trying to make an enemy to do damage to me it doesn't work.
@snowynights1593
@snowynights1593 2 жыл бұрын
Idk if you'll see this but im having a problem with this line of code: GetComponent().enabled = false; it's giving me this error in unity: Assets\Scripts\Health.cs(34,30): error CS0246: The type or namespace name 'PlayerMovement' could not be found (are you missing a using directive or an assembly reference?) do you have any solutions?
@PandemoniumGameDev
@PandemoniumGameDev 2 жыл бұрын
Did you call your player movement script differently? If so you have to adapt this line as well, use the name that you chose
@snowynights1593
@snowynights1593 2 жыл бұрын
@@PandemoniumGameDev yup, i got it, thank you
@Solbast
@Solbast Жыл бұрын
what if i want the "saw" to flip when it comes back? i'm using own sprite sheets so i used a new one for the saw
@echohaaff9642
@echohaaff9642 Жыл бұрын
Same way you did with the player! When it changes direction, set the scale on the x to negative (:
@user-mu2hw5cu2i
@user-mu2hw5cu2i 2 ай бұрын
Подскажите. Почему у меня healthbar движется вместе с камерой и персонажем?? Как исправить?
@achsaw6617
@achsaw6617 Жыл бұрын
What if the saw takes 2 hearts why is the heart bar not working correctly? Thank you
@eleven1223
@eleven1223 18 күн бұрын
I’m having trouble getting the heart to add health 😢. All the code looks exactly the same to me. Please helppp
@austinlalawmpuia9449
@austinlalawmpuia9449 7 ай бұрын
I can't drag 10 heart, it select only one
@Chemtekmain
@Chemtekmain Жыл бұрын
when did he change the transitions from idle - attack to anystate - attack? did i miss something?
@cricketo2001
@cricketo2001 5 ай бұрын
Same problem
@hahaeggplanet12
@hahaeggplanet12 2 жыл бұрын
i can pick up health, every system works, but i can't see the health that i'm picking up (the image doesn't show when i run the game)
@tarytale1582
@tarytale1582 Жыл бұрын
Maybe your Sprite Renderer -> order in Layer is the reason?
Unity 2D Platformer for Complete Beginners - #8 IFRAMES
8:00
Pandemonium
Рет қаралды 53 М.
I re-coded Minecraft, purely for MAXIMUM FPS (World Record)
11:26
ЗРЯ Я 24 ЧАСА СТОЯЛ НА ГВОЗДЯХ! #нонале
00:35
What Happens If You Trap Smoke In a Ball?
00:58
A4
Рет қаралды 16 МЛН
How to Sneak Make Up Into Class 💄 #shorts
00:30
BubbleBee
Рет қаралды 15 МЛН
Мама и дневник Зомби (часть 1)🧟 #shorts
00:47
How to make a HEALTH BAR in Unity!
21:06
Brackeys
Рет қаралды 1,1 МЛН
Unity 2D Platformer for Complete Beginners - #10 ENEMIES
52:05
Pandemonium
Рет қаралды 136 М.
Is Strictly Apple a SCAM?
27:22
Austin Evans
Рет қаралды 249 М.
Improve Your Platformer with Forces | Examples in Unity
7:01
Dawnosaur
Рет қаралды 160 М.
Learning Unity Be Like
1:01
Mults
Рет қаралды 1,8 МЛН
MELEE COMBAT in Unity
21:07
Brackeys
Рет қаралды 1,6 МЛН
best fun games at home, cool mobile games ever played 🕷️🤣 5092 #shorts
0:38
Skibidi Toilets vs Hammers and Bollards Part 74 #beamngdrive #skibiditoilet
0:10
VS Car Crash BeamNGDrive
Рет қаралды 28 МЛН
🐶ВЫБЕЙ Признание из Догдея! 👋👮
0:27
Ной Анимация
Рет қаралды 13 МЛН
Charlie Big Brain Moment 🤯🧠 #brawlstars #shorts #bs
0:18
MORTY- Brawl Stars
Рет қаралды 4,4 МЛН