Make a game in under 15 minutes! - Unity 2D

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

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

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

    Thank you so much, I’ve been searching everywhere for similar game ideas, yours hits the closest to what I wanna make!!

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

      I’m glad I could help!! I’ll try do some more one vid mini games in the future - they’re fun!

  • @kadamnable
    @kadamnable Год назад +5

    Great video !! 🦀

  • @paballomolata8844
    @paballomolata8844 8 месяцев назад

    Thank you very much, this is extremely helpful

  • @Badre-eddine81
    @Badre-eddine81 Год назад +1

    Thank you very much for the valuable informations

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

      You’re welcome!! I hope I can keep making videos that’ll help you in the future 🙏

  • @whoami-101_1
    @whoami-101_1 8 месяцев назад

    Amazing video!!

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

    Hello, Thank you for this tutorial

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

      You're welcome I'm glad you enjoyed it!! I'll do some more making games in one vid sometime - they're fun :-)

  • @ST4R._.IS._.M3
    @ST4R._.IS._.M3 Год назад

    ❤ ur videos they help so much !! xx

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

      I’m so glad they help you!! I’ll keep making more so we can keep learning together 😌🙏

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

    At 6:00, my game throws an "Object is not defined" error even though I followed what you did. Can you help explain why that this?

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

      Could you send me the error it’s giving you?

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

      @@GameCodeLibrary Sure, here it is. PlayerMove is similar to your Player
      Tag: Boulder is not defined.
      UnityEngine.StackTraceUtility:ExtractStackTrace ()
      PlayerMove:OnCollisionEnter2D (UnityEngine.Collision2D) (at Assets/Scripts/PlayerMove.cs:150)

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

      @jazioxmugen looks like you need to create the tag “Boulder” on your object! In the inspector there’s a drop down at the top to add tags. It gives this error when that tag doesn’t exist

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

      ​@@GameCodeLibrary I have the tag set as "Boulder" though. That's where I am getting confused. I checked the spelling and everything but for some reason, the error still shows. The boulders hit the platforms and get destroyed and my player doesn't get destroyed as well. This is my code
      private void OnCollisionEnter2D(Collision2D collision)
      {
      if (collision.gameObject.CompareTag("Boulder"))
      {
      Destroy(this.gameObject);
      }
      }

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

      @jazioxmugen that is strange!!! Unity can break sometimes in weird ways, perhaps try closing down your project then reopening and seeing if it’ll work 🧐

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

    Nice video!

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

    Hi and thank you for the tutorial. I'm just starting with Unity after using scratch for over 2 years - I'm 10 🙂
    I'm trying to work through your tutorial but think maybe my system is not right.
    When I go to add the the script 'PlayerController' yours says in the top left hand corner Assembly-CSharp. Mine says Miscellaneous Files (with a icon that says C#).
    When I enter your code some things are not highlighted in blue (MonoBehaviour as an example) could it be that when I create the script, that I somehow need to make sure that it opens with a screen that says Assembly-CSharp?
    If so, can you please advise?
    Appreciate any help :-)

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

      Hi!
      I have another video which should hopefully fix the problem you're having!
      ruclips.net/video/WWmFZGKaLII/видео.html
      Try following these steps and seeing if your scripts work now!

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

    I am at 10:00 and when I try play the game it tells me "The type or namespace name 'Action' could not me found (are you missing a using directive or an assembly reference?)"
    I have used this code alongside a different player movement script I got from a different video I found before this, could it be something tied to that?
    P.S. I am very new to C# and Unity, so if it something obvious, that would be why :). Great tutorial by the way

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

      If there are no red underlines in your code, then check the name of your scripts compared to what they’re called inside!
      At the top, before the monobehavior bit, that’s the name of your namespace.
      That name has to match the name of your actual script file, otherwise Unity can’t find it.

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

    Every time I run this, my game crashes. Can you explain why?

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

      Nevermind, I figured it out! I added the script to my prefab when I should have just added it to the camera

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

    Hello, instead of making it game over, my game is about 3 aestroids with 3 point deduction, so 1 aestroid deducts 10 points the other 20 etc. my total points is 100, if the player collides with the aestroid is it possible to deduct score and there is also a timer. how can i do that?

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

      When we set the player to call the PlayerDied() action, instead deduct your points here - on collision. (Around 8:20 in the video!)
      Then when your points are 0 you can call the game over screen!
      I have another video on adding in a timer and showing the game over screen on timer end as well, you can check that out here:
      ruclips.net/video/T0atxxGoOlE/видео.html
      Good luck!

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

    Heyy at 6:00 i am getting an error in the console tab saying "Trying to invoke method: Objectfallcontr.Fall couldnt be called the game is runiing bit the object is not falling from up

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

      Make sure your capitalization is correct when calling methods to invoke.
      This is how the script should be:
      using System.Collections;
      using System.Collections.Generic;
      using UnityEngine;
      public class ObjectFallController : MonoBehaviour
      {
      float wait = 0.1f;
      public GameObject fallingObject;
      // Start is called before the first frame update
      void Start()
      {
      InvokeRepeating("Fall", wait, wait);
      }
      void Fall()
      {
      Instantiate(fallingObject, new Vector3(Random.Range(-10, 10), 10, 0), Quaternion.identity);
      }
      }

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

      @@GameCodeLibrary i wrote the same exact code but its not working still
      using System.Collections;
      using System.Collections.Generic;
      using UnityEngine;
      public class ObjectFallController : MonoBehaviour
      {
      float wait = 0.1f;
      public GameObject fallingObject;
      // Start is called before the first frame update
      void Start()
      {
      InvokeRepeating("Fall", wait, wait);
      }
      void fall()
      {
      Instantiate(fallingObject, new Vector3(Random.Range(-10, 10), 10, 0), Quaternion.identity);
      }
      }

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

      The capitalization is wrong on your function:
      In InvokeRepeating("Fall", wait, wait);
      it's capital F
      Your void fall()
      is lowercase f
      Make them the same and it'll work! :-)

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

      Thanks it worked, i wanted to ask you if i wanted to. Make the game for android or ios what should i write in the player controller code so. It can move right or left

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

      @@magnificientcars9769 You'll have to look up a tutorial for that since it depends on how you want to move 👍 Good luck

  • @Unknown-wx6td
    @Unknown-wx6td Год назад

    heyy!! i am having an error on 4:42 where you are adding the ObjectFallController script tag to the main camera i copied all the steps but when i am adding the script to main camera its showing "cant add the script component because the script cant be found and there is no errors in the script too

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

      Double check the name of the script within the script compared to the name of the script file in Unity! If they're different it doesn't work and can give this error :-)
      Hope this helps!

    • @Unknown-wx6td
      @Unknown-wx6td Год назад

      @@GameCodeLibrary thank you it worked but only one floating object is falling not multiple floating objects

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

      @Unknown-wx6td have you made the falling objects prefabs by dragging them from the hierarchy to the folder? Then delete the one in the hierarchy and use the prefab in your script slot.

    • @Unknown-wx6td
      @Unknown-wx6td Год назад

      @@GameCodeLibrary when i did that not a single object is falling

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

      @@Unknown-wx6td That's strange!! I can only suggest checking through the video again at the part of creating the objects - since I can't see your project to help out!
      Hope you can find the problem 🙏

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

    Why am i floating when i used the falling thing

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

      I need help

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

      I don’t know!! Can’t see any of your code lol if you follow every step in the vid it’ll work 🙏 promise! There must be a little mistake somewhere!

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

    By any chance can you point me into the right direction where the crab has three lives?😅

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

      I have a video coming out on Friday where I add a player health with three hearts to our platformer game, but you can use the same method I do there for this crab game as well!! 😊
      But you’ll basically want a variable for the crabs health that decreases when hit. Then only call game over when the health variable is at 0! 🙏

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

      @@GameCodeLibrary you are my favorite RUclipsr thank you so very much

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

      You’re welcome and thank you I’m glad you enjoy my vids!!! I’ll keep trying to make simple and fun tutorials 🙏