At 1000 subscribers i will be making a BRAND NEW CHANNEL purely for high quality game dev TUTORIALS so make sure to subscribe now to get access to free tutorials! :)
i was going through video after video, trying to find respawning script that restarted the whole scene and none of them worked until i tried this one, thanks for the good tutorial!
how do you do this with a checkpoint, I dont wanna make players anger of having to re-do entire levels from the beginning. So of course if they die before every finding 1st checkpoint restart from beginning, but if checkpoint found. Start game at that point.
i'm trying to make a hazard that can be bypassed if the player is in a certain state. how would you do this? say the player script has a boolean "invulnerable"
This guy gets a like a sub and a comment from me thank you so much its so simple and easy and how you explain everything afterwards is just so nice so truly thanks besides the fact that my enemy just disappers afterwards T.T
You probably don't read comments on this video anymore but it's kinda slow at spawning like after my character touches the death object it takes about half a second. Do you have any ideas as to why?
I tried doing this with a Enemy patrol when he's moving back and forth but for some reason my enemy just falls off the entire platform when I press play
That's because of the 2D Box Collider has the "Is Trigger" checked, you can add a second 2D Box Collider that has "Is Trigger" unchecked. It should fix it for now.
can someone help me It dosent work but it says there are no errors tag player has: Player Scene name: SampleScene This script is in the object that is suposed to kill the pkayer Respawn: 0 Scenes: one scene the Player just stands on it code: using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement; public class dying : MonoBehaviour { public int Respawn; // Start is called before the first frame update void Start() {
} // Update is called once per frame void Update() {
In my visual studio, it's saying 'Respawn': member names cannot be the same as their enclosing type. It won't let the game play without it being fixed so how do I fix this?
I dont know how to fix this but if u still need help i fix the problems by looking at what it says than looking at my code and seeing if i can connect things
What do I do? 'New to coding' error CS0103: The name 'SceneManager' does not exist in the current context using System.Collections; using System.Collections.Generic; using UnityEngine; public class EnemyofSousa : MonoBehaviour { public int Respawn; // Start is called before the first frame update void Start() { } // Update is called once per frame void Update() { } void OnTriggerEnter2D(Collider2D other) { if (other.CompareTag("Player")) { SceneManager.LoadScene(Respawn); } } }
using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement; public class KillPlayer : MonoBehaviour { public int Respawn; // Start is called before the first frame update void Start() {
} // Update is called once per frame void Update() {
@@aquaignisium7089 try recreating your script , change the name to something simple like 2 or 3 letters and then copy and paste your last script but without the pre-written things. i don't know the warning but when bblakeyy said to change the name i thought this idea might help more since unity does all the job and connects everything on its own
At 1000 subscribers i will be making a BRAND NEW CHANNEL purely for high quality game dev TUTORIALS so make sure to subscribe now to get access to free tutorials! :)
the script doesn't work anymore
@@alexandrux6744 it does work
@@bblakeyyy can you make an video eith kill player script for moving enemyes
@@alexandrux6744 when I reach 1000 subs I’m making a new tutorial channel
@@bblakeyyy can i have some help please? When the level resets is there a certain way to stop certain things from resetting? For example my music?
HOW CAN THE SMALL RUclips CHANNELS HAVE SO MUCH BETTER TUTORIALS THAN THE BIG ONES
fr
So true
The best tutorial ever! So easy for beginners to follow. Thanks!
Glad it was helpful!
It's crazy how good of a video this is, it's so simple and well explained, thank you! :D
It seems simple... But it didn't work T^T
@@ronttu6001 🤔worked for me
@@Goggi_ gonna try that again tomorrow... Maybe I just messed something up '\_("3)_/'
I got this working and now I'll need a launch pad... That didn't work, maybe I'm just Bad at coding :(
@@ronttu6001 Nah coding is just pure pain :/ but good luck to you. :D
took me weeks to figure this out until i saw your tutorial. Thanks so much!
again your 4 year old tutorial helps me out, thanks
Bro honestly this is the only tutorial that worked, thank you
these videos help a lot man thanks!! please keep it up helping me make my first platformer!
Michael Geraghty thank you bro! Make sure your subscribed for more :) I’ve got a start menu video coming out later today❤️🤚🏻
Dude I LOVE YOUR TUTORIALS MAN. THANK YOU!!
yo its charcool
Thank you so much
I love how you explained it! Very easy to understand what is happening.
Bblakeyyy you are amazing i wish you had more subscribers you deserve the most!!!
Thanks, this helped out a lot and I loved how short it was
just watched an hour video and it didn’t work... but this one did,, thank u so much
You’re welcome
the great thing about this is you make new scripts for new features so if I use someone else's code for say movement then I can use your death script!
i was going through video after video, trying to find respawning script that restarted the whole scene and none of them worked until i tried this one, thanks for the good tutorial!
Make sure to subscribe to the new tutorial channel!
you should have put in the video that the player character needs a rigidbody2d and boxcollider2d for this to work, mine didnt work until I added those
@Toast34251 he is one with the gods
You are an absollute legend. You are getting a SUB.
You just saved me on my assignment, thank you so much!!!!!
this video was very helpful even though im working 4 years from which this video was made.
Not working the " void OnTriggerEnter2d(blablabla)"
after 3 years, this still works.
I thought it didn’t work until I realized i set the death wall to a Box Collider, not a Box Collider 2D.
You deserve more subssssss!!!!
Thank you🙏🏻🙏🏻
Amazing tutorial I know I’m really late but thank you!
Thank you!! This helped me so much.
This was very helpful. Thank You :D
Easy and straight to the cheese thanks mate!
You just carried me through a game design class, this was super helpful thank u
hahaha awesome. glad to hear it
I was looking for gold, I got a diamond! thanks you so much.
thank you so much, helped me a lot :)
im getting this error: Assets\Scripts\RestartOnTouch.cs(24,13): error CS0103: The name 'SceneManager' does not exist in the current context
I'm looking back through this did you ever find a solution I'm getting the same problem
@@jambon9613 i dont remember this, its probably something really easy, im sorry i cant help much
@SHINSANE nah its no problem I think I got it sorted so I hope it doesn't happen again
It said the script needs to derive from MonoBehaviour which I don't understand
same
this channel should have more subs
good video, question: did you have a stroke writing your username?
how do you do this with a checkpoint, I dont wanna make players anger of having to re-do entire levels from the beginning. So of course if they die before every finding 1st checkpoint restart from beginning, but if checkpoint found. Start game at that point.
Thanks this helped me allot.
Tom Gragor no problem make sure to sub for more :)
really helped me out,thanks!
it says this when i do what you said Assets\KillPlayer.cs(24,44): error CS1002: ; expected
thank you very much!!!
very helpfull video :)
thanks so muuch bro this is so helpful
thx man helped me alot
very great tutorial dude
the kill function works but the respawn seems to be broken... it just unloads everything
amazing tutorial
ok ithink unity hates me i cant make this work either on C# or Bolt i dont know whats happening
Thanks dantdm this helped me big time
dude, thanks that really helped me alot:)
Thanks this helped a ton
I edit a little bit in code and it work well in 3d
i'm trying to make a hazard that can be bypassed if the player is in a certain state. how would you do this? say the player script has a boolean "invulnerable"
This guy gets a like a sub and a comment from me thank you so much its so simple and easy and how you explain everything afterwards is just so nice so truly thanks besides the fact that my enemy just disappers afterwards T.T
I keep getting error CS0246 and it says Int cannot be found are you missing a directive or an assembly reference
hello, am trying to make a death animation/ death transition but idk how to do that. ( pls help if u can )
help: when i reload the scene my PlayerController script gets broken (i can no longer move my player using W A S D keys). Someone knows why?
You probably don't read comments on this video anymore but it's kinda slow at spawning like after my character touches the death object it takes about half a second.
Do you have any ideas as to why?
I tried doing this with a Enemy patrol when he's moving back and forth but for some reason my enemy just falls off the entire platform when I press play
That's because of the 2D Box Collider has the "Is Trigger" checked, you can add a second 2D Box Collider that has "Is Trigger" unchecked. It should fix it for now.
@@carloshilario6201 Thx 😎
Thanks!
thank you for best tutorial 👏👏👏
This helped thank you so much
Very helpful!
does anyone know how to convert it to work in a 3d game?
watch a hard ass 21 minute tutorial x Watch a 933 subscribed guy with ez tutorial ✅
I have a problem where after the scene resets the kill player script goes away until i leave playmode
doesnt work for me, i collide with the block and nothing happens
Thanks for showing bro :)
i have a gun script and i cant use it after my respawn how can i fix that
can someone help me It dosent work but it says there are no errors
tag player has: Player
Scene name: SampleScene
This script is in the object that is suposed to kill the pkayer
Respawn: 0
Scenes: one scene
the Player just stands on it
code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class dying : MonoBehaviour
{
public int Respawn;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
void OnTriggerEnter2d(Collider2D other)
{
if (other.CompareTag("Player"))
{
SceneManager.LoadScene(Respawn);
}
}
}
the player shouldn't stand, is IsTrigger checkmarked?
man, void OnTriggerEnter2D not 2d
@@ПетарРадосављевић-п2ф fixed it long time ago btw
ty because im making my first working game :D
bblakeyyy more like bracky
god bless brackeys soul but no
ty this helped me out!
You just earn a like and sub my man thanks alot
In my visual studio, it's saying 'Respawn': member names cannot be the same as their enclosing type.
It won't let the game play without it being fixed so how do I fix this?
I dont know how to fix this but if u still need help i fix the problems by looking at what it says than looking at my code and seeing if i can connect things
@@IsabelLovesFoxes Ehhhh I kinda gave up on that project
@@eeveelegion5916 well if you ever work on another do that its fixed like 70% of my errors
İt says that The name SceneManager does not exist in current context can you help me?
Nvm solvent it by adedini scenemanagment thingie ::))
I did this in 3D and for whatever reason I’m not dying, do you know why?
Low budget brackeys
You’re not wrong
The Type or namespace 'SceneManagement' Does not exist in the namespace 'UnityEngine'. Are you Missing an Assembler reference? Pls help me
Remember to use unityengine.scenemanager at the top of the script
@@bblakeyyy i Type that and i got the Same error
What do I do? 'New to coding'
error CS0103: The name 'SceneManager' does not exist in the current context
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class EnemyofSousa : MonoBehaviour
{
public int Respawn;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
void OnTriggerEnter2D(Collider2D other)
{
if (other.CompareTag("Player"))
{
SceneManager.LoadScene(Respawn);
}
}
}
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.SceneManagement;
public class KillPlayer : MonoBehaviour
{
public int Respawn;
// Start is called before the first frame update
void Start()
{
}
// Update is called once per frame
void Update()
{
}
void OnTriggerEnter2D(Collider2D other)
{
if (other.CompareTag("Player"))
{
SceneManager.LoadScene(Respawn);
}
}
}
@@InspeWave Yis3ed dinak shoo ini ba7ibak
why does respwan change scenes colour?
I have a problem I have the whole script right but its not working at all. But still great tutorial ;)
Same here did you figure it out
If you join the discord server we can help you out more
Necromancy at it's best
it still works 3 years later lol
What Unity version are you using?
Thank you bro!!
worked epicly very cool
it just keeps going through it help please help
also i used your moving tutorial in your second channel
help me doesn't work it just fases thru brick
you need to add a box collider 2d to the thing you want to kill the player
Why did you make all your videos private for a while
when i hit the object that is supposed to kill the player nothing happens
felsflop Go into inspector mode and check that your collider’s IsTrigger function is on.
It doesn't work for 2019 doesn't it
my one doesnt work and says "the script needs to derive from monobehaviour" do you know whats wrong?
The name of the class has to be exactly the same as the script name next to monobehaviour
@@bblakeyyy ty this helped alot :) keep up the good content
thanks a lot
it was helpfiull
hey, i followed all the steps, but my player goes right through. Any tips?
Make sure the enemy has a box collider which is not a trigger
i did every step and it didnt work
Thank You very much :D
What to do if it doesn't work😨
Mine just acts like if it destroyed the player.
Thanks!😀
The referenced script (unknown) on this behavior is missing! warning I am getting every time
AquaIgnisium the name of the script has to be the same as the name at the top inside the script, on the same line as mono behaviour
@@bblakeyyy that did not work
@@aquaignisium7089 try recreating your script , change the name to something simple like 2 or 3 letters and then copy and paste your last script but without the pre-written things. i don't know the warning but when bblakeyy said to change the name i thought this idea might help more since unity does all the job and connects everything on its own
it sadly didnt work for me ;((
I have exact same code as you but i dont respawn and Just phasr trough it
Same