Godot 4 - Basic 3D w/ UI Template

แชร์
ฝัง
  • เผยแพร่เมื่อ 24 ธ.ค. 2024

ความคิดเห็น • 23

  • @Chevifier
    @Chevifier 2 ปีที่แล้ว +22

    Canvas Layer is non positional so you dont need to set is as the root node plus you dont need a secondary viewport for what youre doing here.
    In 3D you can use the canvas_layer as your base node for your UI scenes.

    • @Holonet01
      @Holonet01  2 ปีที่แล้ว +10

      Ah, thank you, I see 👍. For anyone reading, TLDR would be that there's always a "root" viewport, so only the camera & environment are truly necessary, the subviewportcontainer, etc... was gratuitous for minimal setup 😅. Appreciate it, I'll pin this in case more comments end up in here later.

  • @MattWyndham
    @MattWyndham 8 หลายเดือนก่อน +3

    Project Settings > General > Display > Window > Size > Mode: Maximized

  • @cocolennon_
    @cocolennon_ ปีที่แล้ว +4

    You're not the hero we wanted.
    But the hero we needed.

    • @Holonet01
      @Holonet01  ปีที่แล้ว +2

      Haha, thanks very much! That's a high bar 🍻

  • @overnights2572
    @overnights2572 6 หลายเดือนก่อน

    Thanks a lot for this video, if I am not mistaken, the subviewport is useful for post-processing, shaders and other opengl stuff, it has more features then the root viewport, it is maybe a good idea to implement one since the beginning avoiding headaches in the future.
    It is interesting how people try find problems instead of being grateful for your work.
    Cheers mate!

    • @Holonet01
      @Holonet01  6 หลายเดือนก่อน

      Thanks! I did legit learn about the default viewport after posting this video, but indeed, this will have applications beyond just the default "template" I was aiming for.

  • @Greensburgg
    @Greensburgg 4 หลายเดือนก่อน

    So I just tried putting UI nodes under a Control node...and it just worked? What's the benefit of doing it this way instead?

    • @Holonet01
      @Holonet01  4 หลายเดือนก่อน +1

      Yep, Chevifier pointed out what basically amounts to that and I pinned his comment ^^^. Personally, I still like to set it up this way from a strictly organizational standpoint, but you're right that it is not necessary. The sub viewport is also not needed, but you can play with it and do some other stuff if you like, say, having a UI in a region of the screen, etc... I haven't tried the control node without a canvas layer at all, but you might want the canvas layer there, at least, even if it's not positional. If you end up making a more complicated UI, you might want to put stuff on top of each other, and need to specify the rendering order/layer.

  • @tenaciousscholar
    @tenaciousscholar ปีที่แล้ว +1

    Why did you originally add a subviewportcontainer?

    • @Holonet01
      @Holonet01  ปีที่แล้ว

      That was not actually necessary. The comment I pinned from Chevifier mentions that as well, there isn't actually a need for an additional viewport container. As to the why, just my mistake is all. I suppose the way I did it might be a start at doing a split-screen or the like with UI elements, though I haven't tried that out yet.

  • @mantra1229
    @mantra1229 ปีที่แล้ว +2

    I don't understand how this is so convoluted, it should really just be a text3d node and you put that on. Surely the developers look at this workaround and go "yeah, that's not ideal"

  • @bogchamp5627
    @bogchamp5627 ปีที่แล้ว

    I am trying to add in a health bar and for some reason it is affecting my camera movement. Do you have any idea why this is

    • @Holonet01
      @Holonet01  ปีที่แล้ว

      Not sure without more information. So, I tried setting up the very basics (without the subviewport which, as folks helped out with in comments, was unnecessary).
      I have the canvas w/ a texturebar in the corner as an example, and then I tried this as a very quick script to test moving the camera:
      public override void _PhysicsProcess(double delta)
      {
      Vector2 direction = Input.GetVector("ui_left", "ui_right", "ui_up", "ui_down");
      var Camera = GetViewport().GetCamera3D();
      Camera.RotateX(direction.Y/45f);
      Camera.Translate(new Vector3(direction.X, direction.Y, 0f));
      }
      And that worked to use the arrow keys to mess with the position, and it did not change my texturebar position, but I'm not sure what you mean by "affecting camera movement" either. It might depend on node setup, something moving with a child under it that's moving as well, etc...

    • @bogchamp5627
      @bogchamp5627 ปีที่แล้ว

      @@Holonet01 thank you

  • @LunarEchox
    @LunarEchox 8 วันที่ผ่านมา

    Future here! they fixed! it

  • @itsfela
    @itsfela ปีที่แล้ว +1

    Thank you :)

    • @Holonet01
      @Holonet01  ปีที่แล้ว

      You're welcome 👍

  • @countryball-orgn.
    @countryball-orgn. 7 หลายเดือนก่อน

    this is so hard bro😂😂😂😂

  • @GeorgiosB
    @GeorgiosB 11 หลายเดือนก่อน

    Does every video have to include chewing sounds? I didn't know this was an ASMR video. LOL. Can't pay attention to the words. Anyone else? No, just me? Cool.

    • @Thegetitguy
      @Thegetitguy 10 หลายเดือนก่อน +1

      People arent typically aware of how their mouth sounds from extremely close up. I had that problem when i first got a mic that i used close to my mouth. You have to retrain how you speak.

    • @oroshi858
      @oroshi858 10 หลายเดือนก่อน +2

      just you