Unity 2D Platformer for Complete Beginners - #13 CHECKPOINTS & RESPAWN

  Рет қаралды 40,580

Pandemonium

Pandemonium

Күн бұрын

In this episode we'll add checkpoints and the ability to respawn the player after dying.
➤ Checkpoint Sound: mega.nz/file/KxNSRS6L#Sw4eB5L...
➤ Complete project: github.com/nickbota/Unity-Pla...
Subscribe and turn on the notifications if you don't want to miss the next episode!
➤ Discord : / discord
➤ Patreon: www.patreon.com/pandemonium_g...
➤ Instagram: / pandemonium_games
➤ Twitter: / pandemoniumnick
➤ Itch: nickbota.itch.io/
#pandemonium #unity2dplatformer #unitybeginner
Tags: Unity 2D Platformer for Complete Beginners,platformer for complete beginners,Unity 2D Platformer episode 13,pandemonium unity,unity 2d platformer,unity respawn 2d,unity respawn,respawn system unity,unity checkpoint system,unity checkpoints,unity checkpoint,unity checkpoint respawn 2d,unity checkpoints respawn,unity respawn at checkpoint,unity platformer respawn,unity checkpoint tutorial,unity respawn tutorial,unity die and respawn,unity death and respawn
0:00 Intro
0:12 Cleaning Up The Scene
1:28 Checkpoints
4:57 Player Respawn
9:23 Checkpoint Activation
13:32 Final Result & Outro

Пікірлер: 119
@PandemoniumGameDev
@PandemoniumGameDev 2 жыл бұрын
In the next episode we'll add a main menu, a game over screen and other UI stuff. Thanks to everyone for the patience!
@SSMLivingPictures
@SSMLivingPictures 2 жыл бұрын
Its worth the wait!
@PandemoniumGameDev
@PandemoniumGameDev 2 жыл бұрын
@@SSMLivingPictures Glad you feel that way, because the wait is LOOOONG 😂
@SSMLivingPictures
@SSMLivingPictures 2 жыл бұрын
@@PandemoniumGameDev 😅👍 All good. It takes me a long time to put what Ive learned into action.
@ubershoku4563
@ubershoku4563 2 жыл бұрын
thank you for making a very good guide and tutorial. i found your video are very helpful and help me to understand on how unity and how the C# syntax are coded. As a beginners i would like copy and learn on the parts and maybe adjust it for better understanding which is why i really love your video about it.
@Chitose_
@Chitose_ 2 жыл бұрын
does this include a levels system? i hope that gets added
@YourGameDevTutor
@YourGameDevTutor Жыл бұрын
Honestly probably the best tutorial playlist for 2d unity on KZbin
@jerryrogers8679
@jerryrogers8679 2 жыл бұрын
This is a great series! Thank you for doing this!
@jnilsson89
@jnilsson89 2 жыл бұрын
Thank you very much for these Unity tutorials, they've been excellent so far.
@itsalwaysunny
@itsalwaysunny 2 жыл бұрын
thanks for your hugh help, you don't even know how much your tutorials helped me in my college projects, thank you soo much once again. keep respawning ;-)
@Gokun1102
@Gokun1102 2 жыл бұрын
oh gosh ! I was looking forward to your videos so much! Thank you so much for your guidance
@tommasoraimondi6908
@tommasoraimondi6908 2 жыл бұрын
Great man, those tutorials are getting better and better!
@PandemoniumGameDev
@PandemoniumGameDev 2 жыл бұрын
Music to my ears, thanks 😀
@boyshader489
@boyshader489 Жыл бұрын
learned all 13 of them,thank you very much!
@blach1526
@blach1526 2 жыл бұрын
Dude, that's awesome, just what every beginner needs. Fucking legend you are!
@paroxysm4566
@paroxysm4566 2 жыл бұрын
the man is back again! good to see you uploading bro
@BillSoutherland
@BillSoutherland 11 ай бұрын
Great tutorial series, thank you for the time and effort. I did notice one little problem and you actually display it in your video: when the player dies and is transported to the last checkpoint, the obstacles (that's what I call them) in that room do not appear - though they will reappear if you move to the next room and then move back.
@severin9801
@severin9801 2 жыл бұрын
youre the best, keep going !
@jasonnjoroge7947
@jasonnjoroge7947 Ай бұрын
This is the best tutorials ever in 2D
@PandemoniumGameDev
@PandemoniumGameDev Ай бұрын
Thanks a lot!
@SSMLivingPictures
@SSMLivingPictures 2 жыл бұрын
Youre awesome man!!!
@turtlegod1013
@turtlegod1013 9 ай бұрын
During the end result, when you respawned, the arrow trap in the first room didn't activate. How would you fix that issue?
@manuelestebanpadilla1225
@manuelestebanpadilla1225 2 жыл бұрын
YOOOOO just now I needed how to respawn the player when he dies, thanks :D
@PandemoniumGameDev
@PandemoniumGameDev 2 жыл бұрын
I knew it :D Glad to help!
@iiv13tkd92
@iiv13tkd92 2 жыл бұрын
I love the tutorial, it is really helping me and is there any way where the game can be timed, with the player performance based on the score achieved over a certain time
@cleangaminganalysis8651
@cleangaminganalysis8651 2 жыл бұрын
lets go new video
@kieranryan7625
@kieranryan7625 2 жыл бұрын
Hey! Thank you so much for this series, it's been a blast so far and feel like I've learned so much. I'm currently trying to make the camera shift up or down to a upper/lower room when the player goes through the door but can't seem to make the code work haha. I have a copy of the door just at ceiling level. Any help would be appreciated, Thanks!
@mfspawn1474
@mfspawn1474 Жыл бұрын
Thank you so much for these videos, been following the whole way and am finally caught up to date. Everything works perfectly, altough if you spam space while you die you get stuck in an invulnerable state and are still able to move but not attack or actually die. I followed the previous videos exactly and it even respawns if you die in mid air. But if you spam space you don't respawn and are invulnerable. Did I mess something up or does this happen to you also @Pandemonium? Again thank you so much and sorry for the wall of text.
@noisepipa
@noisepipa Жыл бұрын
same happens with me
@arkhamknight3335
@arkhamknight3335 2 жыл бұрын
You rock bro
@trunghieuthai9472
@trunghieuthai9472 9 ай бұрын
Why can't I move when I return to the checkpoint when I die?
@al4965
@al4965 2 жыл бұрын
Great video, simple explanation that make things more clearly and easy! but do you know how to make a finish line that will go to another scene?
@PandemoniumGameDev
@PandemoniumGameDev Жыл бұрын
At the end of episode 11 we loaded the second level, so you can just use the same logic only apply it to a new object when it collides with the player.
@kechrimpari2348
@kechrimpari2348 Жыл бұрын
In which tutorial is the components heading added along with it's code? I've searched through the tutorial but haven't been able to find it
@etfi8642
@etfi8642 2 жыл бұрын
You forgot to add the respawn sound link, other than that, amazing video :D
@PandemoniumGameDev
@PandemoniumGameDev 2 жыл бұрын
Snap, completely forgot. Here it is: mega.nz/file/KxNSRS6L#Sw4eB5LEKRVbNyfz0aleRH3B-Te36AHKm7RVOLID-xc
@MiyamotoMusashi209
@MiyamotoMusashi209 Жыл бұрын
HI, whenever i try to play my character sometimes falls over of does loads of flips, what could i do to fix this?
@maksimuz3640
@maksimuz3640 2 жыл бұрын
Will you make change weapons (sword/gun for example ) and new types of enemies flying etc.
@PandemoniumGameDev
@PandemoniumGameDev 2 жыл бұрын
Sorry but nope, I'll make a menu system, a couple levels and a boss and that's it for this series.
@YourGameDevTutor
@YourGameDevTutor Жыл бұрын
Hi mate, ever since episode 7 my character falls through the ground when taking damage from an enemy. Does anyone have any idea why this could happen?
@zoks
@zoks Жыл бұрын
If the player does not pick up any checkpoint and dies, they will be respawned at the location they died at, which is probably not what you want. Should set an invisible checkpoint at the start of the level, right at the player's starting location, and disable sprite renderer on that individual checkpoint.
@snowsetdeer6192
@snowsetdeer6192 Жыл бұрын
First I'm really glad you pointed this out, my checkpoint was in the first room so I probably wouldn't have ever noticed that this happens. I tried to just make a checkpoint without the sprite renderer, and it was indeed an invisible checkpoint on top of where the player spawns in, but it still made the "getting a checkpoint" sound. To fix this I made another prefab called "spawnpoint" by just dragging and then renaming a checkpoint into the prefabs collectibles folder, and added a new tag called Spawnpoint. Then I went into the PlayerRespawn code and copy pasted these 3 lines of code(without the sound line!) into a new if statement inside the OnTrigger2DEnter method, but checked for the spawnpoint tag instead of the checkpoint tag. My OnTriggerEnter2D method now looks like thise: //activate checkpoints private void OnTriggerEnter2D(Collider2D collision) { //fixes issue where if player had no checkpoint, they respawn exactly where they die. In the hierarchy, the sprite renderer //is turned off, and this is the same as a normal checkpoint just with the sound disabled. It reads the tag to make sure its the correct thing if(collision.transform.tag=="Spawnpoint") { currentCheckpoint = collision.transform; //sets first spawnpoint for the player before any checkpoints //SoundManager.instance.PlaySound(checkpointSound); //mutes "get checkpoint" sound collision.GetComponent().enabled = false; //makes it so you can't reactivate the same checkpoint over and over collision.GetComponent().SetTrigger("appear"); //triggers appear checkpoint animation (could probably comment out too) } if(collision.transform.tag=="Checkpoint") { currentCheckpoint = collision.transform; //store checkpoint that we activated as current checkpoint SoundManager.instance.PlaySound(checkpointSound); collision.GetComponent().enabled = false; //makes it so you can't reactivate the same checkpoint over and over collision.GetComponent().SetTrigger("appear"); //triggers appear checkpoint animation } } I hope this helps someone else!
@fudzicrew1615
@fudzicrew1615 2 жыл бұрын
best tutorial
@bazej616
@bazej616 2 жыл бұрын
maybe in the future make tutorial for boss fight or how to make customs units for some begginers :D
@maxrobloxgaming9043
@maxrobloxgaming9043 Жыл бұрын
I have a problem where when I died and spawn back and died again I didnt respawn back and play the "Die" animation
@AnEmortalKid
@AnEmortalKid Жыл бұрын
If we are using the follow camera we don't need to reset the camera after respawn correct, since the next update frame on that camera will move to where the player has been respawned to (I much more like the follow player cam instead of room based cam). I didn't notice any visual difference when not moving the camera, but I was wondering if perhaps there's something about moving it besides just focusing on the correct thing.
@AveryCruz-se5ky
@AveryCruz-se5ky Ай бұрын
What would be the code for the camera if I'm using the follow player camera?
@AnEmortalKid
@AnEmortalKid Ай бұрын
@@AveryCruz-se5ky it’s been a year so I don’t exactly remember if he talks about it in other videos but The camera controller should get a reference to the player In an update method, set the cameras position to the players position.
@AnEmortalKid
@AnEmortalKid Ай бұрын
@@AveryCruz-se5ky also look at episode 6 in the series. That’s where the first follow camera occurs.
@gluharone
@gluharone Жыл бұрын
Сan you implement shooting 45° up, 45° down, shooting down while jumping, and shooting up?
@ldmdesign5610
@ldmdesign5610 Жыл бұрын
Would love a tutorial on a swinging rope ;)
@ushas3349
@ushas3349 3 ай бұрын
I am unable to solve the following issue! If I call respawn after the deactivate funtion by adding event, the respawn does not happen! If I call respawn one time frame before deactivate event at the die animation sequence it works. I tried including gameObject.Setactive(true) in respawn function. Then also it does not respawn!! I wondwr what could be the problem! Any suggestion / hint please. Thank you for the wonderful series. Usha
@ushas3349
@ushas3349 3 ай бұрын
I think once the gameobject is deactivated, its not possible to activate the same as no method attached to it is available. So instead of deactivating the game object I disabled the sprite rendter component and enabled on spawn player fn. It works. Hope my understanding is correct. Thanks Usha
@bernardogamula947
@bernardogamula947 Жыл бұрын
heyy! I need help... when I kill the enemies or get the hearts and then I die and go back to the cheackpoint, these objects don't appear again can someone help them to appear again
@EliteSchokokeks
@EliteSchokokeks Жыл бұрын
Hey, I came across a Problem, maybe someone can help me. As you can see in the Video at 13:35 the Arrowtrap is shooting downwards, if i rotate my Arrowtrap it does not, i dont see arrows and i dont get damaged
@EliteSchokokeks
@EliteSchokokeks Жыл бұрын
Nevermind...my Arrows had the wrong sorting layer thats all...
@adriankirita9013
@adriankirita9013 2 жыл бұрын
My checkpoint animation doesn't play, only the sound, do you know what might be the problem? I also get the error message "Parameter "activate" does not exist." when I trigger the checkpoint.
@adriankirita9013
@adriankirita9013 2 жыл бұрын
Found the problem, in the code the trigger was "activate" instead of "appear"
@PandemoniumGameDev
@PandemoniumGameDev Жыл бұрын
@@adriankirita9013 Yeah the trigger names can be an issue if you don't get them right.
@ushas3349
@ushas3349 3 ай бұрын
Hi I have finished upto 13. But in respawn player , there is a small issue i am facing. If I create an event after deactivate event (1s) and assain respawn it does not work. If I call the event 1 time frame before deactivate, it works. Its bugging me. Can anyone tell me why? Thanks usha
@Tubcio
@Tubcio Жыл бұрын
Bro can you help me with an issue i can't fix? Issue: when I'm walljumping and I'm touching ceiling, once I press space again(touching wall) sometimes I'm spinning and when I'm on the floor I land on my head, right side or left side, could you help me?
@yiblee5262
@yiblee5262 Жыл бұрын
Maybe could check the freeze rotation on the player's rigidbody?
@Tubcio
@Tubcio Жыл бұрын
@@yiblee5262 thx, I'll check
@Tubcio
@Tubcio Жыл бұрын
@@yiblee5262 Oh my god, I didn't know that it was so easy to fix this issue, thanks a lot!
@v9ui
@v9ui Жыл бұрын
How to add reference to gameobject please tell me sir please
@manuelestebanpadilla1225
@manuelestebanpadilla1225 2 жыл бұрын
I have a problem, for some reason the character only revives 1 time and then doesn't die, the damage animations don't appear after he respawns either, any suggestions?
@PandemoniumGameDev
@PandemoniumGameDev 2 жыл бұрын
Sounds like you didn't add dead= false; in the Health script, in the Respawn method (7:54). If that's not the case check if you have any errors in the console.
@manuelestebanpadilla1225
@manuelestebanpadilla1225 2 жыл бұрын
@@PandemoniumGameDev thanks, now is working
@bazej616
@bazej616 2 жыл бұрын
@@PandemoniumGameDev THANKS
@ashhx.
@ashhx. 2 жыл бұрын
@@PandemoniumGameDev ty
@animeclips684
@animeclips684 2 жыл бұрын
Loved all the videos of the series but got a little problem after the last one. The thing is my game has started to lag in play mode after applying all the code in the video. Would love if you could help. Thank you so much.
@PandemoniumGameDev
@PandemoniumGameDev Жыл бұрын
Weird, do you have any errors in the console?
@lukspie
@lukspie Жыл бұрын
I'm having a problem with my player respawning but he is like constantly respawning somewhere else.. I tried spamming jump.. and it worked but still its not a solution.. even tried to unfreeze his Z position, which fixed it but y'know.. it's not really a fix fix..Any idea?
@mrbanana8085
@mrbanana8085 Жыл бұрын
im also having the same problem he just respawns wherever he dies whenever he dies and it just glitches, i got the ullReferenceException: Object reference not set to an instance of an object error, if you find a solution p[lease infrom me, thsnk you.
@inhhuuiem6230
@inhhuuiem6230 2 жыл бұрын
i watched from lesson 1, but i have a problem with this, player dies without checkpoint but still respawns. Do you have any suggestions?
@PandemoniumGameDev
@PandemoniumGameDev 2 жыл бұрын
Yeah, currently the system will respawn the player even if you don't have a checkpoint. An easy fix would be to put a checkpoint right at the start of the game, although it's not a proper solution. I'll work on that in the next episode.
@inhhuuiem6230
@inhhuuiem6230 2 жыл бұрын
@@PandemoniumGameDev We are looking forward to the next episode
@Max-mb2zp
@Max-mb2zp 2 жыл бұрын
How do you make sure that the game can be played on the iPad?
@PandemoniumGameDev
@PandemoniumGameDev 2 жыл бұрын
First you'll need to take care of the controls, I recommend adding some buttons that handle the Horizontal Input because you don't have a keyboard there, also a button for jumping and another one for shooting. Second make sure that the UI is scaleable. Thirdly switch the project to iOS inside Unity and see if you need to adjust the camera size. That's it really, might not be 100% straightforward but should be entirely doable.
@Max-mb2zp
@Max-mb2zp 2 жыл бұрын
Ok, thanks!
@Max-mb2zp
@Max-mb2zp 2 жыл бұрын
@@PandemoniumGameDev Would you like to make a video about that?
@cattoman1
@cattoman1 2 жыл бұрын
how do i fix my character not respawning at all
@sansguerra2265
@sansguerra2265 Жыл бұрын
I have that problem as well
@cattoman1
@cattoman1 Жыл бұрын
@@sansguerra2265 add a respawn event at the end of the death anim
@jasonnjoroge7947
@jasonnjoroge7947 Ай бұрын
am having 2 issues 1. Parameter 'grounded' does not exist 2. my gameover screen not showing at end of gameplay
@jasonnjoroge7947
@jasonnjoroge7947 Ай бұрын
Sorry on episode 14
@azizmuhammadiev8229
@azizmuhammadiev8229 Жыл бұрын
where is the falling animation. when player fall from some platform, there is no animation of the fall
@juneha
@juneha 2 жыл бұрын
Everytime my player respawns I am unable to move or do anything. Any help please, its either stuck in running animation or idle
@PandemoniumGameDev
@PandemoniumGameDev 2 жыл бұрын
Hey there, check if you have any errors in the console. Also check if you added the code that reenables the components inside the Health script.
@juneha
@juneha 2 жыл бұрын
@@PandemoniumGameDev No errors, and I believe I have but i may be missing some parts in health cos i skipped the enemies episode
@babayaga6247
@babayaga6247 2 жыл бұрын
I have the same problem and i dont know what to do:(
@babayaga6247
@babayaga6247 2 жыл бұрын
I fixed it, my problem was when i died, my player movement got off, but didnt start, so i just add GetComponent().enabled = true;
@PandemoniumGameDev
@PandemoniumGameDev 2 жыл бұрын
@@babayaga6247 That should've been fixed when we reenabled all the components. What you did works too, but you're doubling what already should've been working. Check if you added the Movement to the Components array in the Player's Health script in the editor.
@GUstudios
@GUstudios Жыл бұрын
sir i started viewing this series now but the codes are not working that i copied from you
@jeevansai6835
@jeevansai6835 Жыл бұрын
iam facing a bug when the player got respawned once it is not respawning again just beling like invincible going on with zero health and no damage is getting for hero
@jeevansai6835
@jeevansai6835 Жыл бұрын
the mistake is in Respawn() in health.cs ,when the respawn happens the value of dead(boolean) is in the state of true soo that the dead animation is not activated and the player became invincible check this out i think i fixed it public void Respawn() { AddHealth(startingHealth); anim.ResetTrigger("die"); anim.Play("idle"); StartCoroutine(Invunerability()); dead = false; //to set the state of the hero is not dead //Activate all attached component classes foreach (Behaviour component in components) component.enabled = true; }
@dilrabog3457
@dilrabog3457 2 жыл бұрын
Sorry but my fireball still does not work well. The animations are good but the fireball just does not fly away
@LavenderIV
@LavenderIV 7 ай бұрын
Hi! I know this will probably be overlooked but I am at my wits' end. I followed the tutorial and even copied and pasted the scripts in the complete project file, but my character still wont respawn. My character dies but is still able to slide around and jumping snaps it out of the death animation. I took out the sound parts of the code since it was messing with unity. If someone sees this, please help. The midterm for this game is in 3 days and I am STRESSED
@simonadaquino8981
@simonadaquino8981 7 ай бұрын
hello, i am having the same problem. have you been able to fix that? any help would be appreciated, i hope you were able to complete the game for the midterm!
@dhciufhddhfdjdjfjf7854
@dhciufhddhfdjdjfjf7854 6 ай бұрын
@@simonadaquino8981 hey and u too lavenderIV, did you guys fix it?
@bayuahmadfirdaus1635
@bayuahmadfirdaus1635 Жыл бұрын
my player doesnt want to move after it respawns, can anybody help me?
@kyuijin4763
@kyuijin4763 Жыл бұрын
Probably, you didn't do "GetComponent().enabled = true;" at the respawn method
@taxxir8757
@taxxir8757 Жыл бұрын
@@kyuijin4763 Thank you a lot!!!
@dakshkataria7959
@dakshkataria7959 Жыл бұрын
lol the 1st episode had 300k views and the last has 4k
@PandemoniumGameDev
@PandemoniumGameDev Жыл бұрын
My videos gain views slowly, I'm no MrBeast 😁 Also the first one was uploaded like a year and a half ago, this one just a month ago. It's 6.5K now btw and it's gonna grow for sure, give it some time.
@BillSoutherland
@BillSoutherland 11 ай бұрын
let us be honest, people are mostly lazy and will give up when they run into difficulties, or they will just download the completed projects and try to reverse engineer - which I think explains many of the questions that you see posted about tutorials.
@hails_3028
@hails_3028 2 жыл бұрын
go next video padal, or mat kanava
Unity 2D Platformer for Complete Beginners - #14 GAME OVER
21:40
Pandemonium
Рет қаралды 37 М.
Testing 8 Innovative New Boat Propeller Designs
24:08
rctestflight
Рет қаралды 461 М.
Glow Stick Secret (part 2) 😱 #shorts
00:33
Mr DegrEE
Рет қаралды 45 МЛН
didn't want to let me in #tiktok
00:20
Анастасия Тарасова
Рет қаралды 11 МЛН
Normal vs Smokers !! 😱😱😱
00:12
Tibo InShape
Рет қаралды 54 МЛН
[Vowel]물고기는 물에서 살아야 해🐟🤣Fish have to live in the water #funny
00:53
Mojang just changed Pistons forever. And people hate it.
4:06
Phoenix SC
Рет қаралды 702 М.
Disney's Most Advanced Animatronics - You'll Be Amazed
14:44
Fastpass Facts
Рет қаралды 33 М.
3 ways to do a Ground Check in Unity
15:58
Code Monkey
Рет қаралды 220 М.
How to make a BOSS in Unity!
21:54
Brackeys
Рет қаралды 654 М.
TOUCH CONTROLS in Unity!
16:09
Brackeys
Рет қаралды 1,3 МЛН
Emulating biology to make tiny robots
12:05
Breaking Taps
Рет қаралды 134 М.
2D Animation in Unity (Tutorial)
21:53
Brackeys
Рет қаралды 2,4 МЛН
💀
0:15
DegelSC
Рет қаралды 14 МЛН
Bull Solo x Duo Challenge 😈
0:35
Toodyxz
Рет қаралды 5 МЛН
Когда разрабы пофиксят это
0:56
Garga
Рет қаралды 2,2 МЛН