HOW TO CHANGE SCENES WITH A TRIGGER IN C# UNITY TUTORIAL

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

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

  • @josh_fisher
    @josh_fisher 5 лет назад +52

    I think you're honestly the best RUclipsr to do tutorials on unity. Thanks for the content, sir!

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

      i must agree with this man you are the best

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

      dani is better

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

      @@friesneverdies those arent even tutorials... I was joking

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

      Brakeys and jimmy vegas are good to

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

    This is great
    but my issue is that my player just walks into the trigger and it moves away, im guessing it needs to be translucent so that I can actually walk into it

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

    THANKS REALLY THANKS I THINK I WASTE 50 YEARS LOOKING FOR A TUTORIAL FOR THIS YOU SAVED MY LIFE

  • @sandortoth5269
    @sandortoth5269 4 года назад +1

    came here to see how to switch between scenes in unity and got exactly that.
    no more, no less.
    deserves a thumbs up.

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

    My problem was solved within the first minute and a half - how to add scenes to the Build Setting. Thank you so much.

  • @theamazingfan8889
    @theamazingfan8889 5 лет назад +14

    Sir you are really hardworker

  • @charab1153
    @charab1153 4 года назад +12

    I, like many others here, appreciate your explanations! Compared to many other tutorials I've tried to follow, your coding actually works! THANK YOU!

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

    No Joke! I searched like 2 Hours and watched like 20 other Videos and then your with the simple 4 mins just killed it! xD THX so much I feel kinda stupid now but THX 4 REAL!

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

    thank you so much! i've searched for minutes and minutes to try making a script like this, but it didn't work, anyways thanks!

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

    So much better than other tutorials! You explained everything so clearly. Thank you

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

    thank you bro
    even 2 years after upload....it still helped me
    you earned a sub + a like

  • @TheMansard
    @TheMansard 4 года назад +6

    Thank you for the quick tutorials. Fantastic work! This is exactly what one needs when just starting to use Unity.

  • @elsenussi
    @elsenussi 4 года назад +1

    Brother, when I keep searching about something I want to my game , I find your helpful tutorial in front of my face haha, Thanks a lot dude , you are the Best , you made the program so easy .

  • @garbski42
    @garbski42 5 лет назад +2

    Thanks! I've been struggling with this for a week now!

  • @darkvioletcloud
    @darkvioletcloud 25 дней назад

    This tutorial was great! Every other tutorial I tried to follow ended up being far too confusing for such a simple concept.

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

    Thank you soo much i have been spending days on finding a video that works thank you
    :)

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

    Thanks for the quick tutorial, helped a bunch!

  • @SirMicrowaveMan
    @SirMicrowaveMan 4 года назад +6

    Thanks so much
    I was about to give up on my game because of this

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

    Love the tutorial, everything works great, thanks man.

  • @animatorsstudio1511
    @animatorsstudio1511 4 года назад +1

    Thank you it really worked keep adding videos of unity

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

    i was looking for a while to find a tutorial, you have helped me greatly

  • @mansodev
    @mansodev 4 года назад +1

    This is the best tutorial I've seen

  • @kyandesutter1364
    @kyandesutter1364 4 года назад +7

    i used triggers in all of my holes so if you fall into a hole it just loads the same scene :P
    ill use this for my finish trigger to go to the next level.
    thanks!

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

    THANKS SO MUCH! I WAS LOOKING EVERYWHERE FOR THIS!!!

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

    thanks this works great but how do I use it on the next screen? when I try to do it it won't let me use the script with a different load scene number with out changing the first one?

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

      you can either use a new script or use an integer variable to change it

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

    Thank you so much, your tutorials are so easy to follow.

  • @michaelcapone175
    @michaelcapone175 5 лет назад +1

    Thanks Jimmy. Being new to Unity I was looking for something just like this. Great video.

  • @CrabmanStuff
    @CrabmanStuff 5 лет назад +2

    Thank you So Much :D
    I Started Making Games With Unity In 2019 And I'm Getting Better And Better At Unity Because Of These Videos Thank You :)
    I'm Trying To Make Games To Sell On My Website

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

    Let’s go! It’s short, simple, and works!

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

    THX YA SO MUCH! I NEEDED IT, ITS WAS NECESSARY

  • @kape5105
    @kape5105 4 года назад

    Thank you so much ive searched this about 1-2 hours!

  • @empirewilddog
    @empirewilddog 4 года назад

    You Sir are a good Human Being. I was struggling a lot trying to create a Level Trigger.
    definitely subscribing to you.

  • @e-r-r-o-r--5-2
    @e-r-r-o-r--5-2 Год назад

    Your the only one that worked Thank you

  • @katharinaz6785
    @katharinaz6785 4 года назад +4

    Thanks for your tutorials!!! For anybody who has to use loads of different scenes in one project/ going back smd forth between differeny scenes (and who is a noob in coding) I duplicated the script then changed the name of the script and of course also the reference right in the beginning of the code of course :) that avoided compiler errors for me! I am sure there is also a way by elaborating the code a little bit but I didn’t have the time to look up how ;)

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

      THANKS !

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

      @Jarreth Oglesbee what exactly do you need to change in the code? I changed the number after LoadScene but I still get a error.

  • @Stinger-rq4gy
    @Stinger-rq4gy 3 года назад

    thanks Jimmy for makin these videos🏆

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

    Bro this helped me out so much thank you

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

    Thank you for this simple yet great tutorial!

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

    Outstanding! Simple and to the point! Thank you for sharing!

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

    Perfect, exactly what i was looking for, other yt tutors showed complicated ways involving expensive assets.
    Thx master ✌️

  • @azertclipz8522
    @azertclipz8522 4 года назад

    Thanks this helps me with alot of stuff. Menu, next scene ect. Thanks

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

    Is it fair to say it is quite a bit more complex if I am trying to bring data from scene to scene? Such as life bar, inventory....thanks as always for your vids they are fantastic

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

    Thank You sir! this is very helpful and useful, you actually deserver more subscribers

  • @begreen2809
    @begreen2809 4 года назад

    Thank you so much! This is really helpful!

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

    Thanks really straight forward and helped alot

  • @ZaphonRBL
    @ZaphonRBL 17 дней назад +1

    Can you make a tutorial on how to make a Timed scene where when the player enters a trigger a timer will start and when the timer reaches 0 it will change scene? Or does anyone know in this comment section? If so send me a youtube link, or reply to this comment with the script pls

  • @Dhairya_Mistry
    @Dhairya_Mistry 4 года назад +1

    OMG!!!!!!!!!!!!!!!!!!!!!!!!!!!! it works!!!!!!!!!!!!!!!!! thanks bro, i have try to switch from long !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

  • @Andistyle1
    @Andistyle1 4 года назад

    Thank you so much. Works fine!

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

    hey sir! thanks a lot for this tutorial, it really save my life!

  • @flpe7111
    @flpe7111 4 года назад

    Thank you so much for the help.

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

    TY

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

    thank you so much this helped a ton!

  • @muhamadfikribayuaji8138
    @muhamadfikribayuaji8138 4 года назад

    Thankyou very much Jimmy

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

    Great Tutorial! Just if any of u guys are wondering, If u created your own physics system with unity this won't work unless you attatch a rigidbody to the area you want to trigger, and select the Kinematic body type :)

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

    u are the best i cant thank u more

  • @anis9427
    @anis9427 4 года назад

    this so easy than the rest of other tutorial

  • @thebigbell3242
    @thebigbell3242 4 года назад

    Thank you so much my game I finally coming to gather your the best yesssssd

  • @Patricko22
    @Patricko22 4 года назад

    Works in 2020! Thank you sooo much!

  • @accountsstudiolcd8960
    @accountsstudiolcd8960 4 года назад

    thankyou jimmy vegas sir so much thankyou that your video helps me a lot thankyou sir now i can make my hdrp fps game simply !thankyou sir!

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

    Awesome, thanks so much!
    But how would we change the script if we wanted to trigger the change by pressing a button?

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

    THANKK BROOOOO!!!.. YOU SAVE MY LIFEE😂

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

    hello! I just dont get it.. Which Object is your Player? I can load a new Scene like you, but my player will not get into it. It's actual a gameobject of the first scene, i am pretty sure it will just get destroyed with it. How do i have to define it correctly? As a prefab? Do I need an empty gameobject as placeholder in every single scene or just a simple instance of my player in every single scene?? I just started using unity..

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

      you have to have another player in the other scene

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

    thanks, i could make my level system for my game!

  • @kaptainklump7525
    @kaptainklump7525 4 года назад +1

    Is there a way to do this, but make the player load at a certain position in the newly loaded scene?

  • @tek_ark
    @tek_ark 4 года назад +1

    Thanks so much!

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

      holy i cant beleive im back here

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

    Thank you!

  • @victorrus01
    @victorrus01 4 года назад

    Dude, thank you so much!! You solved my error :D :D

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

    When ever I switch scenes the lighting is pitch black, idk what to do.

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

      it’s normal for that to happen in-engine. it doesn’t happen in a full build

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

      @@JimmyVegasUnity thank you!

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

    OMG Thank you so much❤️❤️❤️

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

    THANK YOU SOOOOO MUCH

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

    Hi, after setting all of these you share, I can successfully switch scene but my character cannot move in the second scene. Do you have any suggestion to fix this?

  • @Mradel1996
    @Mradel1996 5 лет назад +1

    Thank U so much. like the only guy that gave me the info I needed!!! Sub for sure no doubt about it!!!

  • @robinvlasveld3594
    @robinvlasveld3594 5 лет назад +1

    ok now how do i go back to the previous scene and start at the same position i left the previous scene? it was something with dont destroy onload but i cant quite figure it out.
    verry nice tutorial!

    • @scrub2657
      @scrub2657 5 лет назад

      Check out playerprefs and how to save player position, just turn the x y and z from a vector into floats. There are plenty of tutorials on youtube

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

    Does anyone know if it works for multiple objects on the same scene. If so then could you explain how.

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

    like a glove!

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

    Is it possible to use an empty game object with a collider and put in the script a public Scene scene; so you can put the same script on any game object and have it load a different scene depending on the specific scene put in the public variable. That way one script to put on multiple objects to manage multiple scenes, rather than a different script for each object and each scene?

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

    Thanks, Sir!

  • @shubhamsharma0099
    @shubhamsharma0099 5 лет назад +1

    Can u help me?
    How to make ontriggerEnter2D waits for another ontriggerEnter2D to change scenes in unity.

  • @thewarden3227
    @thewarden3227 5 лет назад +1

    Hey Jimmy how can I make key prompt when I collide so when we press key it changes scene?

    • @thewarden3227
      @thewarden3227 5 лет назад

      @@spidervini1975 Thanks I will try

    • @scrub2657
      @scrub2657 5 лет назад

      The Warden if you want to press ex: ” E ”. You will have to use GetKeyDown.Keycode(E)

    • @rabuwibu
      @rabuwibu 4 года назад

      @@scrub2657 how to change scene with left click, please?

  • @001Camera
    @001Camera 3 года назад

    i dont have errors in my code or anything but if i walk into it my game just freezez a millie second but it doesnt load the scene?

  • @zak-ks7ee
    @zak-ks7ee Год назад

    Does anyone know how to do this but also spawn the player in a specific location of the map? Would it just be to have an empty object and essentially teleport the player to that empties position before they enter the next scene?

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

    Thank u!

  • @Willskull
    @Willskull 5 лет назад +1

    So, do I have to create a script let's say "SceneSwitch2" to go back to the previous screen?

    • @JimmyVegasUnity
      @JimmyVegasUnity  5 лет назад +1

      Do the exact same but change the scene number

    • @Willskull
      @Willskull 5 лет назад

      @@JimmyVegasUnity Ok, thanks for the reply!

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

      @@JimmyVegasUnity I tried that but it won't do it, it gives me an error thing. please help!!!

  • @Oki2122
    @Oki2122 5 лет назад +1

    Its not working for me, literally I did exactly the same thing you did, everything build settings, script, cube, box collider on trigger, EVERYTHING. It just simply doesn't work, I move through the cube and nothing happens. pls respond my project is due on Friday ;(

    • @Oki2122
      @Oki2122 5 лет назад +1

      *bangs table on the desk 20 times* *bangs it again just to be sure that I know I am dumb*
      Its "Collider" capital C

    • @JimmyVegasUnity
      @JimmyVegasUnity  5 лет назад +1

      Hehe glad you got it sorted :)

    • @sethtowe1081
      @sethtowe1081 4 года назад

      @@Oki2122 HOly thank you I've been trying this for nights now and had the exact same issue except capitalize "On"

  • @RockyGamesYT
    @RockyGamesYT 4 года назад

    YES IT WOKS!!!!!!!!!!!!!!!!!! THANK YOU SO MUCH!!!!!

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

    How do you make another object hit the trigger and switch levels, for example a ball that rolled in to it. What would be the code to switch scenes then?

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

      you would use tags. I have a few videos on how tags work

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

      @@JimmyVegasUnity tysm I didn’t think you would respond cuz this vid is from 2 years ago

  • @Boy-cm8ec
    @Boy-cm8ec 4 года назад

    You are a life saver!!

  • @kkevinC
    @kkevinC 5 лет назад

    Amazing thank you!

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

    i put the exact code in and did everything you said but all it does is it just teleports me when i move around

  • @naserlolee3826
    @naserlolee3826 4 года назад +1

    it says the name DIEDMENU does not exist in the current context
    pls reply i need help

  • @caden5936
    @caden5936 4 года назад +1

    when i try to add the script onto the gameobject it says “Can’t add script component ‘SceneSwitch’ because the script class cannot be found. Make sure that there are no compile errors and that the file name and class name match.” Can anyone help???

    • @vroyett
      @vroyett 4 года назад +1

      same to me, did you fix it?

    • @caden5936
      @caden5936 4 года назад

      Victor Royett no, i still have no idea what to do.

    • @Muugroorber
      @Muugroorber 4 года назад +1

      @@caden5936 What about now? This happens to me, too. Did you solve it?

    • @caden5936
      @caden5936 4 года назад

      MONOTONY AND BOREDOM nope 😢

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

      Hey ! Make sur that line is correct : public class SceneSwitch : MonoBehaviour

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

    I have it set up so when i go to a door you need to do a lockpick "mini game" to unlock the door, this works fine getting to the second scene but when i go back to the main game scene it restarts the progress made. Any ideas on how to fix

  • @mr.awesome5109
    @mr.awesome5109 5 лет назад +2

    Will it work on 2019.1

  • @Just_Gabe
    @Just_Gabe 4 года назад

    thank you so much!!!!

  • @sanzjulio
    @sanzjulio 4 года назад

    how to comeback to first scene at the same point where the plaYer entre the second scene instead of original position?

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

    please help i did as the tutorial says yet i go through my trigger instead of it actually taking me to the next scene

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

    when you get teleported to the next scene how do you make the player teleport to a specific gameobject?

  • @AcridDragoon
    @AcridDragoon 4 года назад +1

    how do i delay the scene switch?

    • @JimmyVegasUnity
      @JimmyVegasUnity  4 года назад +1

      yield return new WaitForSeconds(); inside a coroutine

    • @AcridDragoon
      @AcridDragoon 4 года назад +1

      @@JimmyVegasUnity can you make a tutorial going in depth with this

    • @JimmyVegasUnity
      @JimmyVegasUnity  4 года назад +1

      There's nothing "in-depth" to go into, it's literally that line of code in a coroutine. if that doesn't make sense, there's tons of tutorials on my channel covering waits and coroutines

    • @AcridDragoon
      @AcridDragoon 4 года назад +1

      @@JimmyVegasUnity ok

  • @kayra_iydrss
    @kayra_iydrss 4 года назад

    thankk you good tutorial

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

    when I use the scene manager, my scene is always black, as if the camera is being rendered twice, what can I do?

  • @Charzilian
    @Charzilian 5 лет назад

    if you add a scene to the build will all changes you make after go in? this might be a stupid question, but I am completely new to all of this lol.