Godot 4 | Scene and scene instantiation quick overview

Sdílet
Vložit
  • čas přidán 23. 08. 2024
  • A quick explaination of scenes and how to instantiate them in godot.
    #gamedev #godot #gameengine

Komentáře • 54

  • @lagking1
    @lagking1 Před 6 měsíci +5

    Such an amazing video i was just blindly following the toturials.i had no Idea what instantiate func does please make more videos like this your visual representation of the code is really easy and helpful to understand subbed for future videos

  • @bclikesyou
    @bclikesyou Před 11 měsíci +8

    Super solid tutorial. Quick and to the point with clear visuals. Subbed and keep up the good work!

    • @JumboGamedev
      @JumboGamedev  Před 11 měsíci

      Thank you very much!

    • @ogkay
      @ogkay Před měsícem

      Agreee! Very well done

  • @nionbluh
    @nionbluh Před rokem +13

    Great tutorial! I was having trouble instantiating a scene that I couldn't get at all! With that I learned two things, with two errors, the first error is that the method in which I was using to instantiate scenes is "instance()" which is a non-existent method of packedscene (At least in version 4.0.0 of godot) to if I instantiate scenes, however, with the method "instantiate()" I managed, second error: You cannot instantiate a scene in itself, that is! if I want to instantiate a bullet scene from a gun I can't instantiate it in the bullet scene but in the gun scene or in another scene, anyway, huge text but it will serve as a learning experience for anyone who has the same problem 😊

    • @JumboGamedev
      @JumboGamedev  Před rokem +1

      Thanks for sharing!

    • @bro-rubro
      @bro-rubro Před 11 měsíci +1

      your comment was exactly how i was suffering LOL thanks a lot

    • @nionbluh
      @nionbluh Před 11 měsíci

      @@bro-rubro no problem 😃

  • @stevedowning3892
    @stevedowning3892 Před 9 měsíci +3

    That was so useful. I love the visuals and the message was super clear

  • @RudzaimieNordin
    @RudzaimieNordin Před rokem +3

    yr explanation video are sooooo good and easy to understand because of the animation... please keep doing what your doing now..

  • @stereo92
    @stereo92 Před měsícem

    Great! Solved my doubts in 100 seconds, thanks!

  • @MrSmith_
    @MrSmith_ Před 7 měsíci +1

    Really love the content. Thanks for sharing. I admire your method of teaching and can relate to it very easily.

  • @krazywiki
    @krazywiki Před 22 hodinami

    fantastic tutorial, thanks for making this!

  • @couchbrogames7499
    @couchbrogames7499 Před 9 dny

    So easy to follow. Good job!

  • @kektimus
    @kektimus Před 11 měsíci +1

    Perfect length! Thank you!

  • @Fl4v_
    @Fl4v_ Před 7 měsíci +1

    Actually useful, thanks!

  • @giantfrogstudios839
    @giantfrogstudios839 Před rokem +6

    Great tutorials. Although your audio is pretty quiet.

    • @JumboGamedev
      @JumboGamedev  Před rokem +2

      Thank you for the feedback. I will make sure to fix the audio in future videos.

  • @PokeNebula
    @PokeNebula Před 8 měsíci +1

    perfect, thanks

  • @diablomabbs
    @diablomabbs Před 2 měsíci

    Very helpful, thankyou.

  • @MohamedSamy-vp2pq
    @MohamedSamy-vp2pq Před 9 měsíci +1

    any hope to make gdscript basics series with this amazing explaining?

    • @JumboGamedev
      @JumboGamedev  Před 9 měsíci

      Thank you! Yes, I am planning to make videos about GDScript.

  • @yaseltamayo2367
    @yaseltamayo2367 Před rokem +1

    Me acabas de resolver en un minuto un quebradero de cabeza de casi 24 horas. Gracias.

  • @lightconstruct
    @lightconstruct Před 4 měsíci

    The loaded scene object has no instantiate() method (Godot 4.1.0). However it works with preload.

    • @JumboGamedev
      @JumboGamedev  Před 4 měsíci

      Interesting! It is hard to know the exact reason why this may be happening, but the first thing that comes to my mind is that there is a type mismatch. When you use load() to load the scene, you may be getting a Resource instance? So maybe try to cast the loaded resource to a PackedScene.
      var sceneResource = load("res://myscene.tscn")
      if sceneResource is PackedScene:
      var scene = sceneResource as PackedScene
      var instance = scene.instantiate()

  • @Fylart75
    @Fylart75 Před 3 měsíci

    love it, its very concise and understandable, though I have a question... why doesnt it get added directly in the scene when you instantiate it? isnt instantiate mean that it has added into the scene? why do we need to append it as child? >﹏<

    • @JumboGamedev
      @JumboGamedev  Před 3 měsíci

      Thank you very much! Instantiating a scene creates the object but does not automatically add it to the scene tree. This is great because it gives you control over where and when the nodes should appear in your game. For example, you may want to change/set properties on some nodes before adding them to the tree, or you may want to wait for some time before adding the nodes the tree.

  • @fernandorosascamacho9366

    Gracias, me di cuenta que necesitaba arrastrar la escena en el inspector.

  • @felakos1568
    @felakos1568 Před 9 měsíci

    Thank you sir

  • @DayumAli
    @DayumAli Před 3 měsíci

    AAAA SO GOOD

  • @wElgumi
    @wElgumi Před 8 měsíci

    Nice video, i just have one question how can i instantiate 2 objects at same time?

    • @JumboGamedev
      @JumboGamedev  Před 8 měsíci +1

      Thank you! You can invoke .instantiate() 2 times on the packed scene. This will return 2 different nodes.

  • @valcaron
    @valcaron Před 6 měsíci

    Where did you get that very-very-blue color theme for Godot's editor?

    • @JumboGamedev
      @JumboGamedev  Před 6 měsíci +1

      I used a custom theme. To change your theme, you can go to `Editor` -> `Editor Settings` -> `Theme`. Then, you can use a custom preset.
      I am currently using the following:
      - base color: 11124b
      - accent color: ff0090

  • @Spirhack
    @Spirhack Před měsícem

    best.

  • @toddlask
    @toddlask Před rokem +1

    nice!

  • @giantfrogstudios839
    @giantfrogstudios839 Před rokem

    What software are you using to create your animations please?

    • @JumboGamedev
      @JumboGamedev  Před rokem

      I am still searching & experimenting with different softwares
      to see if there is a quicker way to do the animations.
      After effects seems to be a good option so far, and
      I feel comfortable using it. The only issue is it takes
      a long time to make the animations.
      I think it all comes down to what you feel comfortable with,
      because most softwares out there can do almost anything you can imagine.

    • @giantfrogstudios839
      @giantfrogstudios839 Před rokem

      @@JumboGamedev so you used AE for this video?