Interactable Entities & Doors Using Component Nodes In Godot | FPS Controller Tutorial

Поділитися
Вставка
  • Опубліковано 7 лют 2025

КОМЕНТАРІ • 24

  • @GANsmither
    @GANsmither 28 днів тому

    There are also add_exception and remove_exception methods of shapecasts that can be used to bypass the player model collision.

  • @natanmaia3575
    @natanmaia3575 6 місяців тому +5

    Amazing tutorial! I didn't even consider Shapecasts or using signals for the components!
    Personally, I made InteractableComponent inherit Area3D so I can choose a custom hitbox for the interact zone which doesn't have to be the object's solid collision (small items on the ground may have no collision but large interact zones).

    • @notguitargatekeeper
      @notguitargatekeeper 27 днів тому

      Thanks for the suggestion, I'd rather do this too

    • @jonmike733
      @jonmike733 9 днів тому

      Would that not lead to issues like being able to interact with objects behind walls?

    • @natanmaia3575
      @natanmaia3575 9 днів тому

      @@jonmike733 a recap: my Interactable has any possible shape, and only collides with the Interactor (so the player can stand in that area, for example).
      However, the Interactor (usually in the player) is a raycast or shape cast that can collide with multiple things, including all the wall layers. It stops at the first thing it collided with.
      If the Interactor finds a wall it stops. It won't keep searching further and accidentally finding areas inside walls. That's the advantage of Godot's layer+mask system as layer relationships can be asymmetric.
      iirc the Interactable is layer 7 and my Interactor has masks 1,2,3 and 7 (also account other types of solids)

  • @cyb-m1g
    @cyb-m1g 8 місяців тому +5

    I cant thank you enough for these tutorials

    • @MajikayoGames
      @MajikayoGames  8 місяців тому +3

      Glad you enjoyed :D more videos to come

  • @PastaMaster115
    @PastaMaster115 7 місяців тому +1

    It took me so long to figure out what "i" was until I heard you say "iterations". That makes more sense. You used i in the RiggidBody3D video too and I didn't know what it was then either. Now the code is clicking in my head lol

    • @MajikayoGames
      @MajikayoGames  7 місяців тому

      interesting i don't think i ever realized i implies 'iterations' haha. i always just used i because that's what all the examples used when i first learned loops. i, then j for nested loops, nested again i think it's usually k for the var name. but yes for i in range(0, 10): iterates our i var from 0 to 9 throughout the loop

  • @PastaMaster115
    @PastaMaster115 7 місяців тому +2

    I also experienced that problem you had where the InteractableComponent node showed up in the wrong place and I had to place it in the correct node. I didn't notice it until my door wouldn't work and I kept playing parts of the video over and over. It was that.

  • @drawtheword7590
    @drawtheword7590 3 місяці тому

    so basically this should help people to not be able to push heavy objects like cars as you can in say gta. i have watched this one a few times a great lesson

  • @richardt-w5969
    @richardt-w5969 22 дні тому

    "Hope this tutorial is useful to you".
    Oh yes. Oh yes indeed. Thank you.

  • @BKD639
    @BKD639 8 місяців тому +1

    Amazing

  • @Lexiosity
    @Lexiosity 2 місяці тому +1

    in this tutorial series, could you teach us how to grab objects like in Half-Life 2 or Portal?

  • @pixleartyoutube4795
    @pixleartyoutube4795 2 місяці тому

    thanks

  • @ghorshy
    @ghorshy 3 місяці тому +1

    Hello, I have a problem with the Shapecast that it doesn't hit the object when my character is too close to it ie. is touching it. What's a good fix for that?

    • @ghorshy
      @ghorshy 3 місяці тому

      Okay, found the bug. I write it in C# btw but here it is:
      if (i > 0 && _interactShapeCast.GetCollider(0) == this) --- the bad one
      if (i > 0 && _interactShapeCast.GetCollider(0) != this) --- fixed == to !=

  • @Doom_C
    @Doom_C 8 місяців тому +4

    Yo! First off your FPS controller is a godsend. One thing I did notice though is that if you do a forward jump then try to strafe once airborn you're unable to move left or right more than an inch or two. Is that intended, or is it a bug?

    • @MajikayoGames
      @MajikayoGames  8 місяців тому +4

      Thank you! Yes that is intended, it is emulating the air movement style of classic games like Quake & CSS. You can actually get quite a bit of air control, if you curve the mouse in the direction of the strafe in air. You can get going quite fast actually if you jump repeatedly while doing that, this is called bhop. If you want to modify the air movement code, you can have a look at LegionGames' FPS controller for an example for some more controllable air movement: github.com/LegionGames/FirstPersonController/blob/b8cde5f49872837502cc98aee06ce676d17fbae8/Scripts/Player.gd#L62

    • @Doom_C
      @Doom_C 8 місяців тому +2

      @@MajikayoGames Thanks for the info! Yea I was actually bhopping for quite a while in your fps controller earlier today after I added some modifications to the level. I'm probably going to end up modifying your code for my 3d platformer game. I was previously writing my controller from scratch, but was having trouble with some of the more advanced quirks like bhopping and conservation of momentum. You saved me, and I'm sure countless other people a shit ton of dev time by uploading these vids, and making your code CC0. What else do you have planned for this project if you don't mind me asking?

    • @MajikayoGames
      @MajikayoGames  8 місяців тому +3

      @@Doom_C the next video is probably going to be on sourcelike ladder handling. After that, I'm going to take a break to instead work on my procedural dungeons addon for a bit and add some new features/fix bugs. Then, once that's done, I'm planning on returning to this controller to add a modular weapon system, animated player model, and finally multiplayer.

    • @raminkuntopolku8636
      @raminkuntopolku8636 8 місяців тому

      ​@@MajikayoGamesp2p or a standalone server?

    • @MajikayoGames
      @MajikayoGames  8 місяців тому +2

      @@raminkuntopolku8636 in godot the multiplayer code is abstracted pretty well, so you could easily switch between them. right now i have been doing some testing with webrtc and enet p2p, eventually probably going to get steam peer working. you can run godot in headless mode to run a server for a game.