How to Change Scenes Using a Trigger in Unity 5

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

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

  • @mhdnaderlabbad5887
    @mhdnaderlabbad5887 6 лет назад +31

    For those who do not work with him
    using UnityEngine;
    using System.Collections;
    using UnityEngine.SceneManagement;
    public class changescan : MonoBehaviour
    {
    public GameObject guiObject;
    public string levelToLoad;
    // Use this for initialization
    void Start()
    {
    guiObject.SetActive(false);
    }
    // Update is called once per frame
    void OnTriggerStay(Collider other)
    {
    if (other.gameObject.tag == "Player")
    {
    guiObject.SetActive(true);
    if (guiObject.activeInHierarchy == true && Input.GetButtonDown("noww"))
    {
    SceneManager.LoadScene("2");
    }
    }
    }
    void OnTriggerExit()
    {
    guiObject.SetActive(false);
    }
    }

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

      thanks

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

      there is the new script github.com/UnityTutorialsHD/Unity-Tutorial-Assets/blob/master/OnTriggerLoadLevelV2.cs

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

      @@mikethegamedev Thank you! The other iterations were refusing to detect OnTriggerExit so my canvas was still showing even when I moved out of the trigger zone

  • @wilstrow
    @wilstrow 7 лет назад +103

    you know you found the right tutorial when it is about naruto
    10/10 - ign
    "...would throw a ninja star again."

  • @Ownage4lif31
    @Ownage4lif31 7 лет назад +10

    Damn that Naruto game looks dope. Even if it's a demo for testing, God that's so nice.

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

    Whenever i find these tutorials, i know ill actually understand and get it.

  • @fastpicker89
    @fastpicker89 5 лет назад +8

    How can I determine where my player spawns in the next scene?

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

      it would just be where your camera is

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

      We made a tutorial on how to change scenes and end up in the right spot on our channel.
      ruclips.net/video/U18j9t0XkaA/видео.html
      Hope this helps!

  • @janoschabr
    @janoschabr 8 лет назад +25

    In GitHub , What Is The Script Name??!

    • @Nuff.x
      @Nuff.x 4 года назад +3

      @@positive2897 3 years later lmao

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

      @@Nuff.x HHHAAHHAHAAHAHAHHAHAAHHAHHAAH

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

      If he was final year student.. He already convo👨‍🎓😅

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

      this of course github.com/UnityTutorialsHD/Unity-Tutorial-Assets/blob/master/OnTriggerLoadLevelV2.cs

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

    You are my best unity teacher 🥰🥰🥰🥰🥰🥰🥰🥰

  • @HunterTheWalrus
    @HunterTheWalrus 8 лет назад

    Bro, you da man. What is really funny is that im doing a ninja game based on naruto and i didnt even notice until after i clicked on the video. So for that, you gain a sub. Also you do a great job explaining things! Keep it up man

    • @2kmixedit
      @2kmixedit  8 лет назад

      Thanks man, glad you enjoy my channel :)

    • @HunterTheWalrus
      @HunterTheWalrus 8 лет назад

      Lurony. Okay so if you are familiar with the Naruto series (which I assume you are)
      I have a question about making the tree jumping game mechanic. You know, how they swiftly jump from tree to tree to get to places really fast in the series? Well that's what I want to do. Do you mind if I message you on Skype with a few questions? Don't want to clutter up your YT inbox too much haha

    • @2kmixedit
      @2kmixedit  8 лет назад

      Private message me on youtube

  • @IronEd636
    @IronEd636 7 лет назад +16

    github isn't showing the script. Here he is:
    using UnityEngine;
    using System.Collections;
    public class OnTriggerLoadLevel : MonoBehaviour {
    public GameObject guiObject;
    public string levelToLoad;
    //Use this for initialization
    void Start () {
    guiObject.SetActive(false);
    }
    //Update is called once per frame
    void OnTriggerStay (Collider other)
    {
    if (other.gameObject.tag == "Player")
    {
    guiObject.SetActive(true);
    if (guiObject.activeInHierarchy == true && Input.GetButtonDown("Use"))
    {
    Application.LoadLevel (levelToLoad);
    }
    }
    }
    void OnTriggerExit()
    {
    guiObject.SetActive(false);
    }
    }

    • @DEYROS
      @DEYROS 7 лет назад +1

      error CS1525: Unexpected symbol `void'

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

      i think need to put scneManager

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

    thanks for the help, yo. was really cool to hear more detail bout the script than other script tutorials. I hope your game goes well!

  • @gabrielabrahao7440
    @gabrielabrahao7440 7 лет назад +14

    using UnityEngine;
    using System.Collections;
    public class OnTriggerLoadLevel : MonoBehaviour {
    public GameObject guiObject;
    public string levelToLoad;
    // Use this for initialization
    void Start () {
    guiObject.SetActive(false);
    }
    // Update is called once per frame
    void OnTriggerStay (Collider other)
    {
    if(other.gameObject.tag == "Player")
    {
    guiObject.SetActive(true);
    if(guiObject.activeInHierarchy == true && Input.GetButtonDown("Use"))
    {
    Application.LoadLevel(levelToLoad);
    }
    }
    }
    void OnTriggerExit()
    {
    guiObject.SetActive(false);
    }
    }

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

    Thank you so much, been looking for a tutorial like this for ages. Managed to apply this to my 2D game instead!
    Plus, your game art looks awesome btw

  • @lucagiardina8645
    @lucagiardina8645 8 лет назад

    I cannot find the script on GitHub... how is called?

  • @Tyrellm690
    @Tyrellm690 8 лет назад

    you just saved me !! I have been looking all over on how to do this thank you so much !

    • @2kmixedit
      @2kmixedit  8 лет назад

      No problem :)

    • @Tyrellm690
      @Tyrellm690 8 лет назад

      Any chance you know how i would add a DontDestroyOnLoad to this script? i have tried multiple times and have had no luck with it i got a complex inv script i am using and keep losing all my items when i load to a different area

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

    For those who do not work you can change there on 15th if (other.gameObject.name == "Player") if you dont tag your player (use your player name) :) ty for tutorial hf

  • @becj1473
    @becj1473 7 лет назад +1

    It was very useful, thank you!! I already used it, it works fantastic.

    • @2kmixedit
      @2kmixedit  7 лет назад

      Thank you for watching the video glad it helped you :)

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

    hi, may i know how to make the cursor appear when the player trigger to 2d scene? my problem is when from my 3d scene load to 2 d scene the cursor is missing.. can u help me?

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

    Can you make a video or explain how to go to certain spawn points in a scene depending on where you entered from. For example, if I enter the scene from a "room" that's on the left, how do I make them spawn on the left of the screen and not the right or middle??
    Please

  • @lizwang6190
    @lizwang6190 8 лет назад +2

    Hi, thanks for your tutorial. I have a problem: how to make the trigger associate with loading position? I mean, when changing scene, you simple use loadLevel API, and the player init position is pre-setted. what if there are two doors (A and B) to enter the new scene S, I enter S by door A, but want exit by door B, I don't know how to make the trigger take me to a certain place I set in another scene. do yo have any ideas? hope u could understand me... thanks again.

    • @CrowJam
      @CrowJam 7 лет назад

      you could add a variable like an integer or something that you change to 1 if you went through door A, and to 2 if you went through door B. And once the scene is loaded, make a trigger which checks out the variable ( make it dontdestroyonload ) and depending on what it is, set your players transform.position to where you want them to be

  • @UGPColbyWilliams
    @UGPColbyWilliams 7 лет назад +3

    HELP!! It says " Can't add script component 'Transition' because the script class cannot be found. Make sure that there are no compile errors and that the file name and class name match" I tried everything went back to see if I made any mistakes and non plz help me

    • @2kmixedit
      @2kmixedit  7 лет назад

      Your script name has to be the same in your project and in the script, make sure the names match at your assets and in your scripts before the : MonoDevelop

    • @UGPColbyWilliams
      @UGPColbyWilliams 7 лет назад +3

      Lurony I figured it out what you didn't mention in the video is the object going into the trigger box you need to tag it as "player"

  • @GamingTopTen
    @GamingTopTen 7 лет назад

    I had to "massage" the code to get it to work how I wanted it to (see: actual object instead of a GUI), but the base code was *beyond* helpful.

    • @2kmixedit
      @2kmixedit  7 лет назад

      Thank you, I'm glad it helped :)

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

    What shader are you using for the outlines on naruto?

  • @CarlosGomes-sw6bt
    @CarlosGomes-sw6bt 8 лет назад

    omg thx so much i was dieing to know how to do cut sceans like that :D

  • @Peas3D
    @Peas3D 6 лет назад +1

    "UnassignedReferenceException" The variable guiObject of OnTriggerLoadLevel has not been assigned. It has though.

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

      you need to assign the scene nd in the build setting put all your scene

  • @SecretPack
    @SecretPack 7 лет назад

    This was really helpful and right to the point. Thanks a bunch!

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

    Four bigger if same wont to enter change the sean automatically just don't use input method thear not nessery as well use if (Input.GetKeyDown(KeyCode.E)) instead the input.button you use if i wont specific keyboard key

  • @Zack-dk3pt
    @Zack-dk3pt 7 лет назад

    kinda weird how elementary this info is yet still beneficial to people.

  • @fisslewine1222
    @fisslewine1222 7 лет назад

    How would you have other text appear if a variable is true? As I though you could give more options upon entering a trigger if the player has done something?

    • @2kmixedit
      @2kmixedit  7 лет назад

      Make more GUI's and put them into an empty game object and set that to be the guiObject.

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

    Is there any way to keep the camera as it was when the character was outside the house? As in the original 3rd Person camera from behind him. Thank you for the amazing tutorial btw!!

  • @elouisesheri
    @elouisesheri 7 лет назад

    Is it possible to make it so a door opens and the scene already loaded behind (like with no cutscene) it and when you walk in your in that scene and the door dissapears? wanting to know for a school project

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

    how would you save the camera permission when you go back to the previous scene?

  • @RezaOLine
    @RezaOLine 7 лет назад

    sorry im new here.. i want to know how you make a nice map and graphic like that..?? is there any camera effect..??

    • @2kmixedit
      @2kmixedit  7 лет назад

      The cartoony black outline and the colors are from a shader called TSF I think, just search the asset store for Cartoon Shader. The rest is from the models and the way they're textured. I got the map from here but I did modify it www.models-resource.com/ . If you're new I strongly recommend watching all of the newer videos I have and listening when I explain the coding, I answer some faq in most of these videos that aren't really explained anywhere else and try to explain everything in a way a newbie would understand. Hope you enjoy the videos!

    • @RezaOLine
      @RezaOLine 7 лет назад

      ok.. so a map i made from blender and already textured can be added with TSF right.. sorry im newbie..

  • @watercat1248
    @watercat1248 7 лет назад

    how when I load the map
    to bring the letter before the tin door
    for example, if the above two doors each time to load the map loads of character out of the door correct door without having twice the same map?

    • @2kmixedit
      @2kmixedit  7 лет назад

      I'm sorry but I really don't understand what you wanted to ask try again.

    • @watercat1248
      @watercat1248 7 лет назад

      ie to transfer the character outside of the
      door after what loading

    • @2kmixedit
      @2kmixedit  7 лет назад

      If you want to know how to make a loading screen just load a scene in between the 2 scenes you want to switch. That scene serves as the loading screen, and then in that loading scene add a script that loads the next level after some time.

  • @theanimelibarian7881
    @theanimelibarian7881 8 лет назад +1

    but instead of just teleporting to next scene could i do a cinematic to next scene?

    • @2kmixedit
      @2kmixedit  8 лет назад +4

      Yeah sure, easiest way to do this would be switching to the cinematic scene and just make a script that loads a new level after time, I think I have a video about that uploaded and just set the time duration to the cinematic duration, when it is done just switch to the new scene.

  • @tubesocsamurai1693
    @tubesocsamurai1693 7 лет назад

    What's the song that played at the end of the video?? Plz

  • @OdinIsHere
    @OdinIsHere 7 лет назад

    Can i use it to switch to character to another game (a mini game inside the game itself), how can i switch the controls as the game i would switch to will be a board game.

    • @2kmixedit
      @2kmixedit  7 лет назад +1

      Yes of course, just make the mini game in a new scene and switch to that scene when entering the trigger.

    • @OdinIsHere
      @OdinIsHere 7 лет назад

      Thanks for the reply mate. You've really good tutorials. Keep the good work going.

    • @OdinIsHere
      @OdinIsHere 7 лет назад

      Is it possible that i place the mini map on to the screen and just switch the controls

    • @2kmixedit
      @2kmixedit  7 лет назад

      Yeah place the whole mini game into an empty prefab and just do SetActive(true), and disable the character components, once the mini game finishes just disable it and enable the character components.

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

    Could you make a tutorial on how you made the map and 3d models?

  • @imOnaah
    @imOnaah 7 лет назад

    I've a question. (Sorry for my english)
    I've done all the thing you have done, but it doesn't work.
    When i go into the cube, never happen and in console there's this error:
    UnassignedReferenceException: The variable guiObject of OnTriggerLoadLevel has not been assigned.
    But i've assigned the text at guiObject parameter, into the script in the cube
    Hope you can help me, thanks

    • @2kmixedit
      @2kmixedit  7 лет назад +1

      If you copied the script from the video you might have copied it incorrectly, if you downloaded it from GitHub you didn't assign something. Go to the script and check if everything is in place, after that test out the game its a small error that is easy to fix, something is not assigned.

    • @imOnaah
      @imOnaah 7 лет назад +1

      I've copied it correctly
      But now it works
      Before it didn't work because in the tag of the character there wasn't "player"
      Thanks for all

    • @2kmixedit
      @2kmixedit  7 лет назад

      No problem :)

    • @ValoriumStudios
      @ValoriumStudios 7 лет назад

      Onaa ouɐɟǝʇs dude!!! Please i am having the same problem...how do i change the tag to my player??? I am using fps controller that is buiot into unity!! Help me plssss

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

    This was amazing! Though quick bonus question. Would you have any idea how to make the code spawn the player in a previous position in a scene? When I walk back out into the outside scene it spawns me to the original starting position instead of back at the door I just walked through. Thanks!

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

      We made a tutorial on how to change scenes and end up in the right spot on our channel.
      ruclips.net/video/U18j9t0XkaA/видео.html
      Hope this helps!

  • @2kmixedit
    @2kmixedit  7 лет назад

    Guys, before commenting, watch the whole video, and download the script off github please.

  • @Areshra
    @Areshra 7 лет назад

    The best way (that iv ever seen) to explain the code. You make it easy to understand.
    Keep the good job
    PD: Naruto stuff make it even better.

  • @MartinMcIntoshGameDev
    @MartinMcIntoshGameDev 8 лет назад

    having issues when entering the collider the text isn't appearing nor does the scene change when pressing E.

    • @2kmixedit
      @2kmixedit  8 лет назад +1

      Look at the errors you're having I can't just guess what you did wrong, but its probably something to do with your UI and the Input Manager( you haven't set up the input for Use)

    • @MartinMcIntoshGameDev
      @MartinMcIntoshGameDev 8 лет назад

      Lurony got the issue sorted had to set the fps controller to player

  • @fisslewine1222
    @fisslewine1222 7 лет назад

    How do you get the mouse icon to change when near objects or in trigger area?

    • @2kmixedit
      @2kmixedit  7 лет назад

      Check the Cursor API on Unity's site.

  • @usamazaheer4608
    @usamazaheer4608 7 лет назад

    You Really Helped me :) Gona stay tuned

  • @CraftyMaelyss
    @CraftyMaelyss 7 лет назад

    What if you don't have a "use" section in Unity input in the project settings?

    • @2kmixedit
      @2kmixedit  7 лет назад +1

      Click the plus icon, call it Use and set the positive button to whatever button you want it to be, hope this helps :)

    • @CraftyMaelyss
      @CraftyMaelyss 7 лет назад

      Thank you :D

  • @MonkeyShark
    @MonkeyShark 7 лет назад

    Is there a way to make it where if 2 versions of the player touch the area it will show the button, like if only one player touches the area it wont show up but if both of then touch the area it works, I am making a 2D platform game.

    • @tranquilmagister8481
      @tranquilmagister8481 7 лет назад

      yes when you set that the collision must have a tag just write it like this
      ((other.gameobject.tag == "Player1") &&(other.gameobject == "Player2")

  • @samiulhaque3338
    @samiulhaque3338 7 лет назад

    thanks for the asset bro.this really helps.

  • @zackhernandez1687
    @zackhernandez1687 7 лет назад

    when i try it it says that the level cant be loaded because it has not been added to the build settings. But i did add it to the build settings. Any idea why this isnt working?

    • @2kmixedit
      @2kmixedit  7 лет назад

      The level you're going from has to be in the build settings as well, it could be that or you misspelled the level name.

    • @zackhernandez1687
      @zackhernandez1687 7 лет назад

      Lurony oh sorry I fixed it a while back just forgot to take down my comment lol the problem was that I spelled the level wrong

  • @StarGamesSterre
    @StarGamesSterre 7 лет назад

    i have one error: Assets/Scripts/nextlevel.cs(8.10): error CS1519: Unexpected symbol public in class, struct, or interface member declaration

    • @2kmixedit
      @2kmixedit  7 лет назад

      You copied the script incorrectly you're missing something or you misspelled something.

  • @theanimelibarian7881
    @theanimelibarian7881 8 лет назад

    could i apply this to fighting games stage transitions too?

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

    Great Video! Really helped thank you!

  • @mechaadi
    @mechaadi 8 лет назад

    Hey, please make a tutorial on first person to car switching, that the first person is able to drive the car when a button I press a button

    • @2kmixedit
      @2kmixedit  8 лет назад

      I have a tutorial on switching cameras (from first person to third person and vice versa) so you could watch that on my channel and another newer video I made about accessing other scripts. So you could access the camera script from the enter vehicle script and state that if you are in the vehicle the 3rd person camera is disabled and first person one enabled.

  • @JEFFYABRAHAMURIT
    @JEFFYABRAHAMURIT 6 лет назад

    where can i get this beautiful asset from

  • @bebanjohnson
    @bebanjohnson 7 лет назад

    Can you make a tutorial on how you set up the Kakashi model in the unity project?

  • @redantdeveloper2526
    @redantdeveloper2526 7 лет назад

    Thank a lot, your tutorials are awesome

    • @2kmixedit
      @2kmixedit  7 лет назад

      Thanks man, glad you enjoy them :)

  • @nnkservers5362
    @nnkservers5362 7 лет назад

    PLEASE Make a tutorial about rigging and placing into unity (Applying animations too)

    • @2kmixedit
      @2kmixedit  7 лет назад +1

      I'll see what I can do

  • @FerliKos
    @FerliKos 8 лет назад

    it doesnt show me the "USE" place in the InputManager what do i do?

    • @2kmixedit
      @2kmixedit  8 лет назад

      Create one, call it Use and change the positive button to e

    • @FerliKos
      @FerliKos 8 лет назад

      i'm new to unity so i don't know where to create one

    • @FerliKos
      @FerliKos 8 лет назад

      thanks alot for the help got a sub :D

  • @a-gaming7261
    @a-gaming7261 4 года назад +1

    Thanks Bro!! You saved me

  • @MunroGaming
    @MunroGaming 7 лет назад

    my game isnt like this i used it in this way but in input settings i dont see use and that might be why its not working for me

    • @2kmixedit
      @2kmixedit  7 лет назад

      I said in the video, you have to create the Use input. Just click the plus icon, call the new input Use and set the positive button to e. It should work.

    • @MunroGaming
      @MunroGaming 7 лет назад

      Lurony thx

  • @Kraxaa
    @Kraxaa 6 лет назад

    How can I change the scenes without resetting my heath, thirst and hunger bars ???

  • @mhdnaderlabbad5887
    @mhdnaderlabbad5887 6 лет назад

    Thank you. This helped me a lot

  • @spunkfootgames5948
    @spunkfootgames5948 8 лет назад +4

    Can't find the script

    • @2kmixedit
      @2kmixedit  8 лет назад

      You can copy it from the video, I've lost all of these previously done scripts because I've switched to a new project and got rid of the old assets.

  • @denisshafikov437
    @denisshafikov437 6 лет назад

    Where i can get this level ? ) Tut is nice. But really cool is your level design

  • @nikipompert495
    @nikipompert495 7 лет назад

    How can you make your game so that when you go back outdoors you spawn in front of the house and not somewhere else in the scene?

    • @2kmixedit
      @2kmixedit  7 лет назад

      You could make 2 outdoor scenes that are exactly the same (just duplicate the one you made) and in the duplicate you just created make the player spawn in front of the house you want to enter. Then just make it so that the trigger that changes scenes inside the house changes to the new duplicate scene you made where the player is in front of the house. That's the simplest way and easiest for me to explain in a comment.

    • @nikipompert495
      @nikipompert495 7 лет назад

      Ok ty ill try that

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

      We made a tutorial on how to change scenes and end up in the right spot on our channel, and it works in the current LTS version of Unity.
      ruclips.net/video/U18j9t0XkaA/видео.html
      Hope this helps!

  • @AR-wr4ms
    @AR-wr4ms 7 лет назад +1

    Dude, i have a problem, the real question is how can i make the text fade out, i mean, if i don't want to use the scene changing, the text will be there forever? D: i used it in a bathroom, the cube is in the shower and, with this i change to a shower scene with different camera, but if i don't want to take a shower? the text "press (e) to take a shower is still there, i need help

    • @AR-wr4ms
      @AR-wr4ms 7 лет назад +1

      Let me explain better, when i go through the cube the text appears, if i decide not to use it and go anywhere in te house, the text remains there, i want to make it disappear when i just decide to move from there to another place, it is normal to happen? Cause in the video, your player didn't move after the Text "press (e)" was shown, what if you decided not to enter to the another scene?

    • @2kmixedit
      @2kmixedit  7 лет назад

      You haven't tagged your player "Player" or you haven't written the script correctly, you have the script in the description on the GitHub page. The OnTriggerExit part where I set the guiObject to false takes care of the problem you're having.

    • @AR-wr4ms
      @AR-wr4ms 7 лет назад

      Dude i wrote "OnTriggerxit" thanks a lot...

    • @AR-wr4ms
      @AR-wr4ms 7 лет назад

      Bro, do you have videos of actual videogames you've made? i'm really interested on that, your tutorials ROCK!

    • @2kmixedit
      @2kmixedit  7 лет назад

      I only have one I think, I should make more of those.

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

    best tuts. thanks man.

  • @cleandevstudios9031
    @cleandevstudios9031 8 лет назад

    the script isn't in the github page. Obviously i can just write it down off video but it takes a while. just please make sure ALL of the scripts are on the page.

    • @2kmixedit
      @2kmixedit  8 лет назад

      Forgot to put it up, it isn't a long script tho you could just type it yourself you might learn a thing or two.

    • @cleandevstudios9031
      @cleandevstudios9031 8 лет назад +1

      Lurony yeah i am trying to learn. hey just wanted to say your the best unity youtuber ive because of your art style its like mine its good.

  • @fisslewine1222
    @fisslewine1222 7 лет назад

    How do you make sure the text always faces the player?

    • @2kmixedit
      @2kmixedit  7 лет назад

      If it's an UI element you can't, if it's a 3D plane with text or something there is a rotate function witch follows the position of a transform, you can use that search the unity API.

    • @fisslewine1222
      @fisslewine1222 7 лет назад

      would that be somethign like rotate text = unit vector of the camera position?

  • @bebanjohnson
    @bebanjohnson 7 лет назад

    how did you get that Kakashi skin?

    • @2kmixedit
      @2kmixedit  7 лет назад

      It's a 3d model not a skin www.models-resource.com/search/?q=Kakashi

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

    github isn't showing the script its showing OnTriggerLoadLevelV2.cs which does not work

  • @brentbirdsinger3288
    @brentbirdsinger3288 8 лет назад

    first of all, thank you for the tutorial. I followed along and got almost exactly what I was trying to do accomplished and this was very helpful. May I ask what it is that needs to be done so that my player can switch from the first scene to the second and retain all of its game object data? (such as components, current health and inventory, ect ect) thanks for your time.

    • @2kmixedit
      @2kmixedit  8 лет назад

      It's a bit longer to write, I have my own way of doing this. Add me on skype xxkuhaxx (Uros K) and I'll help you.

    • @brentbirdsinger3288
      @brentbirdsinger3288 8 лет назад

      thank you I will download skype now.
      again, your time is appreciated.

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

      We made a tutorial on how to change scenes and end up in the right spot on our channel, and any data on the player object will persist.
      ruclips.net/video/U18j9t0XkaA/видео.html
      Hope this helps!

  • @theducksneezes4987
    @theducksneezes4987 6 лет назад

    haha, what was that song at the end?

  • @dewi02
    @dewi02 8 лет назад

    Where can I get the Konoha Village and kakashi?

    • @2kmixedit
      @2kmixedit  8 лет назад +2

      www.models-resource.com/

    • @dewi02
      @dewi02 8 лет назад

      Thanks :)

  • @stcojo
    @stcojo 7 лет назад

    Where did you get the Naruto models?

    • @2kmixedit
      @2kmixedit  7 лет назад

      www.models-resource.com/ search for Naruto

    • @stcojo
      @stcojo 7 лет назад

      thank you

  • @artemermolaev303
    @artemermolaev303 7 лет назад

    i have this problem: UnassignedReferenceException: The variable horror of OntriggerLoadLevel has not been assigned.
    You probably need to assign the horror variable of the OntriggerLoadLevel script in the inspector.
    OntriggerLoadLevel.OnTriggerStay (UnityEngine.Collider other) (at Assets/OntriggerLoadLevel.cs:19)

  • @thesaint8748
    @thesaint8748 7 лет назад

    Does this work for a 2D game? Coz i cant seem to get it to work

    • @2kmixedit
      @2kmixedit  7 лет назад +2

      If you're using 2D colliders just change the OnTriggerEnter to OnTriggerEnter2D and the Collider to a 2D one, check the Unity API for all of the 2D collision stuff.

    • @thesaint8748
      @thesaint8748 7 лет назад

      either im stupid or im stupid. This is my code. ive done the edit>Project Settings>input>add use>positive E
      Made a GUI that says press e to enter, put the level in the build thing, added the script to a separate collider box where the door is and still nothing.
      using UnityEngine;
      using System.Collections;
      using UnityEngine.SceneManagement;
      public class OnTriggerLoadLevel : MonoBehaviour {
      public GameObject guiObject;
      public string LevelToLoad;
      // use this for initialization
      void Start () {
      guiObject.SetActive (false);
      }
      // Update is called once per fram
      void OnTriggerStay2D(Collider2D other)
      {
      if (other.gameObject.tag == "Player") {
      guiObject.SetActive (true);
      if (guiObject.activeInHierarchy == true && Input.GetButtonDown ("Use"))
      {
      SceneManager.LoadScene (LevelToLoad);
      }
      }
      }
      void OnTriggerExit2D()
      {
      guiObject.SetActive (false);
      }
      }

    • @thesaint8748
      @thesaint8748 7 лет назад

      never mid my brother. i had to change other.gameobject.tag =="Player" to other.gameobject.name=="Player"
      thank you for the tutorial!

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

    InvalidOperationException: You are trying to read Input using the UnityEngine.Input class, but you have switched active Input handling to Input System package in Player Settings. I get this

  • @karelkuusik3890
    @karelkuusik3890 8 лет назад

    in github what is the scripts name, its not there i believe

    • @2kmixedit
      @2kmixedit  8 лет назад

      Yeah some scripts aren't there, just copy it from the video.

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

    Great tutorial thanks!

  • @redinternet9893
    @redinternet9893 6 лет назад

    how to public scene at script tab

  • @samuelwatts388
    @samuelwatts388 7 лет назад

    Next time please do a walkthrough from scratch please, instead of having all the scripting and world built and then explaining it, it would be much easier for beginners to understand imo

    • @2kmixedit
      @2kmixedit  7 лет назад +1

      The video would take too long if I did everything on the spot from scratch, I write the script test it and then explain to you guys how I wrote it and what everything does and means.

  • @sahlikh1829
    @sahlikh1829 7 лет назад

    how to let the player with the same staff

  • @HikikomoriDev
    @HikikomoriDev 6 лет назад

    Did you model these scenes yourself?

  • @nonsenseffyt302
    @nonsenseffyt302 7 лет назад

    Bro you are the best thank you !

  • @tairaphillip4841
    @tairaphillip4841 7 лет назад

    Thanx lurony 4 yo great tutorials. But i seem 2 have a big problem in having the script run.(no code errors,and nothing happens when i try colliding with the door.not even the ui text shows up.)i followed your steps and watched the video like 12times(aint kidding bro (-_-) ).followed each step carefully but all in vain.Then i had a thought that hit me thinking could it be because am running unity 5.5.1 thats making something go wrong,or is it jst me thats not observing a micro step in the vid that i missed?I would really appreciate your help.and again thanks for the great tuts.

    • @2kmixedit
      @2kmixedit  7 лет назад

      Maybe you haven't set the collider to a trigger?

    • @tairaphillip4841
      @tairaphillip4841 7 лет назад

      Actually i found the probs,
      I didn't tag player on collider.thanks man.
      But is there by any chance we could get the player to stand in the exact position of the door when we get out of the room? (And not at the strt point of the game).

  • @lazydoggaming2155
    @lazydoggaming2155 8 лет назад

    431th subscriber! :D

  • @leanderignacio4238
    @leanderignacio4238 6 лет назад

    Amazing tutorial!

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

    ty for the video!@ pressed like and sub :)

  • @julienobrebski4288
    @julienobrebski4288 7 лет назад

    Still work in v5.6
    Thx bro ;)

  • @omrajeshkbangalore2092
    @omrajeshkbangalore2092 6 лет назад

    Thanks a Lots... Working fine

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

    Gracias hermano me funciono a la perfección :)

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

    Good! thank you :)

  • @s34n2
    @s34n2 7 лет назад

    one problem is that if you are low hp at the first scene, on the second one you will have full hp again

    • @2kmixedit
      @2kmixedit  7 лет назад

      Yeah I made a video how you can fix that, ruclips.net/video/u5Y8QSBfH9c/видео.html

    • @s34n2
      @s34n2 7 лет назад

      oh nice i just watched it and i really understood you, u got a new sub :) btw is that naruto game u working on or is it just for tutorial purposes?

    • @2kmixedit
      @2kmixedit  7 лет назад

      Mostly tutorial purposes just wanted to make it pretty for everyone hahah

  • @makfard9872
    @makfard9872 6 лет назад

    i did as exactly as you said and it didn't work HELP
    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    public class loadScene : MonoBehaviour {
    public GameObject guiObject;
    public string levelToLoad;
    // Use this for initialization
    void Start () {
    guiObject.SetActive (false);
    }
    // Update is called once per frame
    void OnTriggerStay (Collider other)
    {
    if (other.gameObject.tag == "player")
    {
    guiObject.SetActive (true);
    if (guiObject.activeInHierarchy == true && Input.GetButtonDown ("Use"))
    {
    Application.LoadLevel (levelToLoad);
    }
    }
    }
    void OnTriggerExit()
    {
    guiObject.SetActive (false);
    }
    }

  • @dork2fy225
    @dork2fy225 6 лет назад +1

    i clicked cos I saw kakashi

  • @brianmayrose7775
    @brianmayrose7775 6 лет назад

    Good Stuff, thanks

  • @bo2stories
    @bo2stories 6 лет назад

    Can someone comment The script code Please

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

    it doesn't work on 2019.3.11f1

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

      We made a tutorial on how to change scenes and end up in the right spot on our channel, and it works in the current LTS version of Unity.
      ruclips.net/video/U18j9t0XkaA/видео.html
      Hope this helps!

  • @MrBird94
    @MrBird94 7 лет назад

    Thanks dude ! ;)

  • @deftn5883
    @deftn5883 6 лет назад

    Thank you!!