Unity 2D SCENE MANAGEMENT Tutorial

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

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

  • @Centaury1
    @Centaury1 Год назад +4

    Merhabalar, çok yardımcı oluyorsunuz gerçekten. Diğer videoları da sabırsızlıkla bekliyorum. Bir an önce gelirse çok güzel olur 😁

    • @RehopeGames
      @RehopeGames  Год назад +1

      Merhaba, güzel yorumunuz için çok teşekkür ederim 🙏
      Bunları duymak gerçekten motive edici ve benim için kıymetli 😊

  • @codywilliamson1323
    @codywilliamson1323 8 месяцев назад +2

    lol I just found this guy here is so helpful your getting a sub and when ever I need help am going to watch your videos

  • @samoldfield9997
    @samoldfield9997 2 месяца назад +9

    bro you got me each time you say script

    • @hbfl3x50
      @hbfl3x50 2 месяца назад

      😂😂😂 u got me wen u thought of writing this comment LOL!

  • @biged606
    @biged606 Год назад +3

    First Like!!!👌 amazing tutorial! Just keep going!

    • @RehopeGames
      @RehopeGames  Год назад +1

      Thank you so much that's good to hear 🙏

  • @FernandoPosserPinheiro
    @FernandoPosserPinheiro Год назад +6

    Nice video as always 🙌🏼 Maybe you also could explore strategies for how to load the player in the left or right side in next videos

  • @knowledgeseeker8735
    @knowledgeseeker8735 8 месяцев назад +7

    Guys if you are having same problem as me where you can only start at level 1 or else finish point for other levels dont work then u will have to copy paste game manager to all other scenes manually.

  • @Drmelv0131
    @Drmelv0131 11 месяцев назад +1

    How about 3D game for 1st person characther between schene??

  • @thebigguy270
    @thebigguy270 Год назад +1

    I wonder if this system can be used for secret rooms or something, like how Mario has secret rooms that take you back to the level after being cleared?

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

      You can create a new scene for the secret room.
      Or, you can create it in a different position within the same scene.
      When the player enters the secret room, you can change the player's position.
      Honestly, I prefer to create the secret room within the same scene.
      Or, you can also load a different scene within a scene.
      I wish you success in your project 😊

  • @zoterodisuke4398
    @zoterodisuke4398 3 месяца назад

    I'm developing a 2D rocket shooting game with a stage progression system. The idea is to progress to the next stage after either a set amount of time has passed or after defeating a certain number of enemies. The difficulty will increase with each stage, but players will still encounter level 1 enemies even as they advance to level 2 and beyond. The gameplay should feel continuous, allowing for ongoing action while gradually increasing the challenge.

  • @fillowskyy
    @fillowskyy Год назад +3

    Hi! Could you make a tutorial on how to make a unity game like Mamoball? he is very beginner in c# and i can script for walking and other basic stuff but i am having trouble with some things.

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

      I'm thinking of making different 2d games (action , adventure .. etc.) , maybe like mamoball.
      The important thing is that you learn logic. After learning the logic, you can make any game you want.
      if you have enough patience and passion you can make your dreams come true.
      Thank you for your interest 😊

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

      @@RehopeGames thanks for the answer! I don't know much so far, but I'm motivated to learn to create the game of my dreams. I got the basics, but that's just the beginning 😅

  • @smbiplob9476
    @smbiplob9476 Год назад +1

    awesome. thank you so much. subscribed

  • @Satenc0
    @Satenc0 11 месяцев назад

    Works as described, thanks :D, like the way you teach direct to the point, I almost forget to ask, do you know how could I keep my character stats when transitioning scenes? Like in Blasphemous that you transition but keep your health and magic, etc.

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

    need help i want to add condition like if player has collected the key and reached the finish line then the next level will be loaded and if not a message will pop up the collect the key

    • @RehopeGames
      @RehopeGames  Год назад +1

      Hello, this code will give you an idea.
      using UnityEngine;
      using UnityEngine.SceneManagement;
      public class FinishTrigger : MonoBehaviour
      {
      private bool keyCollected = false;
      void OnTriggerEnter2D(Collider other)
      {
      if (other.gameObject.CompareTag("Player"))
      {
      keyCollected = true;
      gameObject.SetActive(false);
      }
      }
      void OnTriggerEnter2D(Collider other)
      {
      if (other.gameObject.CompareTag("Player") && KeyPickup.keyCollected)
      {
      KeyPickup.keyCollected = false;
      SceneManager.LoadScene("NextLevelName");
      }
      }
      }

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

      @@RehopeGames thank you

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

    How can i make my character move from one scene to the other and go back to the previous scene from the right, just like in hollow knight when he go back the previous room?

    • @RehopeGames
      @RehopeGames  Год назад +1

      I understood you question. Actually this is a detailed topic.
      Maybe i can prepare a video about this topic.

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

      @@RehopeGames that would be awesome

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

      @@RehopeGames there is not much information about it, same thing for depth of field in 2d platformer witout bluring the assets in photoshop

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

      @@RehopeGames are u planning a video about it?

    • @limaogameplays8715
      @limaogameplays8715 3 месяца назад

      @@noobdev6464 You can do that (depth of field) using a Global Volume for Post-Processing, Brackeys has a video on the topic

  • @CAM-IS-NOT-REC
    @CAM-IS-NOT-REC Год назад

    it worked before but now im getting the "NullReferenceException: Object reference not set to an instance of an object" error do you perhaps know why?

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

      Hello , did you follow me step by step ?
      I think you probably did not assign the levels to the levels array.

    • @CAM-IS-NOT-REC
      @CAM-IS-NOT-REC Год назад

      @@RehopeGames i dont know what you mean by levels array, can you specify?

    • @CAM-IS-NOT-REC
      @CAM-IS-NOT-REC Год назад

      @@RehopeGames "NullReferenceException: Object reference not set to an instance of an object
      Finish.OnTriggerEnter2D (UnityEngine.Collider2D collision) (at Assets/Scripts/Finish.cs:24)" thats the whole script. The script is called Finish for me but its the FinishPoint script that you made

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

      Can you show me the line 24 of your Finish script

    • @CAM-IS-NOT-REC
      @CAM-IS-NOT-REC Год назад

      @@RehopeGames line 20: SceneController.instance.NextLevel();
      line 24: SceneController.instance.LoadScene(levelName);

  • @LoneWLF_876
    @LoneWLF_876 8 месяцев назад +1

    I'm getting the cs1061 error for my codes

  • @kxmyona
    @kxmyona Месяц назад +1

    script for scene controller:
    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    using UnityEngine.SceneManagement;
    public class SceneController : MonoBehaviour
    {
    public static SceneController instance;
    private void Awake()
    {
    if (instance == null)
    {
    instance = this;
    DontDestroyOnLoad(gameObject);
    }
    else
    {
    Destroy(gameObject);
    }
    }
    public void NextLevel()
    {
    SceneManager.LoadSceneAsync(SceneManager.GetActiveScene().buildIndex + 1);
    }
    public void LoadScene(string sceneName)
    {
    SceneManager.LoadSceneAsync(sceneName);
    }
    }
    script for finish:
    using System.Collections;
    using System.Collections.Generic;
    using UnityEngine;
    public class FinishPoint : MonoBehaviour
    {
    private void OnTriggerEnter2D(Collider2D collision)
    { if (collision.CompareTag("Player"))
    {
    // go to next level
    SceneController.instance.NextLevel();
    }
    }
    }

  • @Narezano-ws6st
    @Narezano-ws6st 15 дней назад

    bruh... I've spent 3-4 hours wondering why it doesn't work, only to find out that I used the wrong Collider

  • @puriceful
    @puriceful Год назад +1

    Hi Friend I often follow your simple and clear videos for a beginner like me, but now I'm having trouble with this video, I followed all the steps checking and double checking, but I always get the same error message:
    NullReferenceException: Object reference not set to an instance of an object
    EndLevel.OnTriggerEnter2D(UnityEngine.Collider2D collision) (atAssets/EndLevel.cs:10)
    can you please help me figure out where i'm wrong, thanks and keep it up.

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

      Hi , thank you for your interest 😊
      Can you show me EndLevel script.

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

      @@RehopeGames thanks for the prompt reply, this is the script
      using UnityEngine;
      public class EndLevel : MonoBehaviour
      {
      private void OnTriggerEnter2D(Collider2D collision)
      {
      if (collision.CompareTag("Player"))
      {
      // go to next level
      SceneController.instance.NextLevel();
      }
      }
      }

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

      did you create SceneController script ?

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

      @@RehopeGames yes

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

      have you added "GameManager" to your scene?

  • @eli___7152
    @eli___7152 11 месяцев назад

    My character does not appear when I change scene. Can someone help me?

  • @VarunAiyar
    @VarunAiyar 6 месяцев назад

    Thank you brother

  • @NhanTran-ij3jc
    @NhanTran-ij3jc 16 дней назад

    thank you

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

    it didnt work

  • @azizbenothmen-iq7ku
    @azizbenothmen-iq7ku 7 месяцев назад +1

    ya hmar give me a dam link to copy and paste the dam code

    • @noona7701
      @noona7701 5 месяцев назад

      😂 nice to see another Arab feeling the same way as me here