How to Add Interaction in Godot 4

แชร์
ฝัง
  • เผยแพร่เมื่อ 28 ม.ค. 2025

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

  • @andyandrew2453
    @andyandrew2453 3 วันที่ผ่านมา +3

    This tutorial is gold. I tried to implement a stove with burning wood and I honestly I really believed that I could do that making multiple stove with the same script. Thanks GOD I found this life saving tutorial!

  • @strandedoutput2916
    @strandedoutput2916 5 หลายเดือนก่อน +16

    Only halfway through the video but I gotta say this tutorial is top notch my man. I was pulling my hair out trying to get this stuff working but you've clarified so many things for me.

  • @celestialteapot6677
    @celestialteapot6677 24 วันที่ผ่านมา +3

    I almost never comment on videos. I want you to know that this playlist has been extremely helpful to me and has put me on a path to actually completing my game. Thank you so much

  • @weonlydesignonce
    @weonlydesignonce 10 วันที่ผ่านมา +1

    Amazing tutorial! I just implemented the basics for my own interaction system, but was not 100% happy with the result. I also tried to make it as flexible as you, but it had a few unplanned limitations in the end. Your approach is way more elegant, I like it. Also there were some subtle mentions in this vid, that helped me to understand some of Godot's structure and how to best work with it better!
    Thank you so much and keep up the great work!

  • @amirosman8797
    @amirosman8797 8 หลายเดือนก่อน +16

    This is amazing, great video man and welcome back, I hope you are planning on making more tutorials

  • @Glanten
    @Glanten 9 วันที่ผ่านมา +1

    I was just adding interactive objects to my first real project - my method starts similar to yours, with a RayCast3D, but I was using Groups to check for interactable items... using nodes as classes is a much better way of doing it, and matches what I'm doing with my player's stats and state machine too!

  • @_xome4ok_348
    @_xome4ok_348 8 หลายเดือนก่อน +6

    Dude, your guides are great, keep up the good work, I'm looking forward to your videos about godot :)

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

    Started strong and god better.
    Nice work.

  • @malplex
    @malplex 7 หลายเดือนก่อน +3

    Just want to say that your tutorials are great, they helped me a lot to learn Godot, thank you

  • @Keallan
    @Keallan 5 หลายเดือนก่อน +2

    bro TYSM for these tutorials!
    i never found any tutorials that are as interesting as yours tbh

  • @NekotoArts
    @NekotoArts 8 หลายเดือนก่อน +2

    The King returns! Also really great resource! Some of this stuff they updated in Godot 4 confused me haha, but it made sense after watching the video.

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

    I've been watching Godot tutorials for a while but this one is very interesting! I never thought about using an animation tree for a door!

  • @Insan_gaming01
    @Insan_gaming01 6 หลายเดือนก่อน +4

    Thank you, friend, for explaining more about what I've been confused about all this time

  • @dazarianwilliams4253
    @dazarianwilliams4253 8 หลายเดือนก่อน +2

    Love your videos, I was worried you were gone after the long time since the last one great to see you're still at it

  • @superandreluizduarte
    @superandreluizduarte 5 หลายเดือนก่อน +6

    A tutorial video that doesn't FEEL like a tutorial is my thing, great video!

  • @TheRealKaiProton
    @TheRealKaiProton 2 หลายเดือนก่อน +1

    Fantastic,
    Im watching while at work lol, Cant wait to get home and try this out.
    this is the reason I started this playlist, I had a 3d scene with a little dude wandering about, and looking online all the things for switches and signals were mental, wanting global scripts with lists of items for interaction and all kinds of crazy, This is exactly what I wanted, assign a button to an object, and have the button do stuff with the object..

  • @grzegorzpedrycz2630
    @grzegorzpedrycz2630 8 หลายเดือนก่อน +6

    Awasome piece of knowlage !

  • @mannythepirate
    @mannythepirate 7 หลายเดือนก่อน +1

    Hey Nagi! I like your videos. Keep it up!

  • @bartimusprimed
    @bartimusprimed 8 หลายเดือนก่อน +1

    Your videos are great, keep up the good work!

  • @ruumroom.
    @ruumroom. 8 หลายเดือนก่อน +1

    amazing video mr nagi keep em coming

  • @TiptoeAndDoomsday
    @TiptoeAndDoomsday 3 หลายเดือนก่อน +1

    Thank you so much for this video, huge help!

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

    welcome back dude

  • @HakanBacon
    @HakanBacon 6 หลายเดือนก่อน +2

    Well made video! Thank you

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

    lol just found your channel like 2-3 days ago and was translating all the interaction stuff from godot 3 video to my 4.2 version XD could of just clicked on your channel to find this updated one smh either way im gonna watch it!

  • @fr_tian
    @fr_tian 3 หลายเดือนก่อน

    Great tutorial, very good use of inheritance.

    • @fr_tian
      @fr_tian 3 หลายเดือนก่อน

      Now come back, it's been 5 months already 😂

    • @NagiDev
      @NagiDev  3 หลายเดือนก่อน

      I'm trying but video editing is hard 😭

    • @fr_tian
      @fr_tian 3 หลายเดือนก่อน +1

      @@NagiDev ik, I've been stuck on the intro of my first video for a few weeks now 😭

  • @amegatron07
    @amegatron07 7 หลายเดือนก่อน +1

    Thanks for the video) Was going to make exactly such interactions, except that I was planning to have multiple "features" of objects, one of which would be "Interactable".

  • @jamesrivettcarnac
    @jamesrivettcarnac 7 หลายเดือนก่อน +1

    This is really well done

  • @josueadair5935
    @josueadair5935 2 หลายเดือนก่อน +1

    I just discover this channel! hope u still active (this help me a lot!)

    • @NagiDev
      @NagiDev  2 หลายเดือนก่อน

      hehe I just have a terrible upload schedule don't worry

  • @alekjwrgnwekfgn
    @alekjwrgnwekfgn 8 หลายเดือนก่อน +1

    Excellent content bro. Sub’d within a minute. Look forward to your upcoming videos; will catch-up with your catalogue.

  • @Dial8Transmition
    @Dial8Transmition 3 หลายเดือนก่อน +1

    6:00
    So I'm a bit confused about the mesh thing. I have models that I've made in blender but can't seem to use them as meshes for my static body. I've tried both gltf and glb files but when I import them they turn into 3DNodes and need inherited scenes

    • @NagiDev
      @NagiDev  3 หลายเดือนก่อน

      The easy method (which I used) is to open the gltf as an inherited scene, copy the mesh instance and paste it in your scene.
      An even easier solution is to just drag and drop the gltf in your scene.

  • @Meraba_Abi
    @Meraba_Abi 7 หลายเดือนก่อน +1

    Amazing work. Keep it up.

  • @MrGD49
    @MrGD49 8 หลายเดือนก่อน +2

    You the GOAT no cap

  • @pixelgoose98
    @pixelgoose98 4 หลายเดือนก่อน +2

    THIS WASSS SOOOOOOO HELPFULL!!!!!!!1

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

    >.> Need more of your First Person tuts

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

      Will do! I'm just struggling to find motivation to get back to making more tuts

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

      @@NagiDev ah rip I feel yah, any cool projects or what not?

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

      nop, just sitting lol

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

      @@NagiDev rip :c

  • @LilFishowo2.0
    @LilFishowo2.0 5 หลายเดือนก่อน

    5:58 i added the if collider is Interactable: line but now it wont show any prompt messages but it wont work without the line
    im on 4.2.2 is that why it no longer works?

    • @NagiDev
      @NagiDev  5 หลายเดือนก่อน +1

      can you please check if you set the raycast to ignore its parent. Because in most cases, it turns out that the raycast is constantly detecting the player's collisionShape, hence no prompt message. This setting might be different for 4.2.2, I'm not sure.

  • @hallo2955
    @hallo2955 7 หลายเดือนก่อน +1

    Thank you for your tutorial. The textures in your videos look amazing. Do you create them yourself? Could you please share your workflow? How do you create the normal maps?

    • @NagiDev
      @NagiDev  7 หลายเดือนก่อน +1

      I'm glad you like them! Yes, I make them using Gimp and Krita. I hand paint all the textures and roughness map. For the normal maps, I draw the depth map (black is deep, white is shallow) and use the normal map filter in Krita to generate the final result.

    • @NagiDev
      @NagiDev  7 หลายเดือนก่อน +2

      I should probably stream my workflow someday lol.

  • @clashofclans9783
    @clashofclans9783 8 หลายเดือนก่อน +4

    Nagi when the player collides with a physical object, the physical object penetrates the wall or the ground. How can I fix this?

    • @NagiDev
      @NagiDev  8 หลายเดือนก่อน

      CharacterBody vs RigidBody collisions tend to be that way. I haven't found an all-in-one fix for it, but depending on your game, you can make both the player and the object be either both rigidbodies or both characterbodies. You can also try the Jolt physics plugin but I'm not sure if it'll fix the issue.

    • @clashofclans9783
      @clashofclans9783 8 หลายเดือนก่อน +1

      @@NagiDev jolt physics didn't fix anything the last solution make player and the object with rigidbody
      Thx Nagi😊🙏🏿♥️

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

    My game immediately crashes whenever I lok at any non-interactable object once I input the code from 7:23, the replacement of interact with collider.prompt_input. I got no clue on ohow to fix this, pls help
    also, the game just crashes whenever I press on any surface that isnt interactable

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

      can you share the error Godot shows on crashing?

    • @mimadm4832
      @mimadm4832 6 หลายเดือนก่อน +1

      I have just decided to copy and paste your code to not bother with the headache, thabk you for the video and everything tho, once I open my pc I will tell the error message

  • @herogirlsky2
    @herogirlsky2 13 วันที่ผ่านมา

    I have a question, and what if i wanted to hold the object like a flashlight with this system?

    • @NagiDev
      @NagiDev  9 วันที่ผ่านมา

      You can have a flashlight scene added to the player and enable/disable it when the player picks it up/throws it down.

  • @Thewallrunner749
    @Thewallrunner749 6 หลายเดือนก่อน +1

    Could you make a tutorial for a pick up and drop system similar to granny ?

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

    do you know how to implement a mouse click into this? ive tried to do replace E with LMB or RMB and it shows up invisible

  • @truenincillo805
    @truenincillo805 10 วันที่ผ่านมา

    In the world I have created interaction with a friendly monster and player with a dialogue, but I have a problem, how do I make it so that when I press the button called yes in the dialogue, I want a function of the script (child node) of another scene (battle) to be activated, how do I make a function that I have created in that script (child node) be activated?

    • @NagiDev
      @NagiDev  10 วันที่ผ่านมา +1

      In the dialogue editor, add a SignalNode in your dialogue, connect the dialogue signal function of the dialogueBox to the function you want to run. Hope this helps! If not, I'm here to help

    • @truenincillo805
      @truenincillo805 10 วันที่ผ่านมา

      @@NagiDev Hello, I want to know if this method works,
      auto loading script, name Game
      signal activar_picapica_global
      func activar_picapica():
      activar_picapica_global.emit()
      print("Activando picapica")
      script, name is ui
      extends Control
      var picapica_activado : bool = false # Controla si picapica está activado o no
      var picapica_instanciada : Node = null # Para almacenar la instancia de picapica
      @onready var picapica = preload("res://Escenas/ParaEquipo/pika_icon.tscn") # Preload de la escena con la animación
      @onready var posiciones = [
      Vector2(350, 45),
      Vector2(350, 132),
      Vector2(350, 220),
      Vector2(350, 308),
      Vector2(350, 397),
      Vector2(350, 483)
      var animaciones_instanciadas = [] # Para hacer seguimiento de las animaciones instanciadas
      func _ready():
      if Game.is_connected("activar_picapica_global", Callable(self, "activar_el_picapica")) == false:
      Game.connect("activar_picapica_global", Callable(self, "activar_el_picapica"))
      print("Señal conectada correctamente.")
      activar_el_picapica(false)
      func activar_el_picapica(activar: bool = false):
      print("se activo")
      if activar:
      controlar_picapica(true)
      else:
      controlar_picapica(false)
      func controlar_picapica(activar: bool) -> void:
      if activar and not picapica_activado:
      instanciar_animacion() # Instanciamos picapica usando el método ya creado
      picapica_activado = true
      for i in range(1, 7):
      mostrar_nodos_vida(i) # Mostrar los nodos de vida
      mostrar_boton_posicion(i) # Mostrar los botones de posición
      elif not activar and picapica_activado:
      if picapica_instanciada:
      picapica_instanciada.queue_free() # Elimina la animación
      picapica_instanciada = null # Limpia la referencia de la animación
      picapica_activado = false
      for i in range(1, 7):
      ocultar_nodos_vida(i) # Ocultar los nodos de vida
      ocultar_boton_posicion(i) # Ocultar los botones de posición
      actualizar_visibilidad()
      func instanciar_animacion():
      for posicion in posiciones:
      var libre = true
      for anim in animaciones_instanciadas:
      if anim.position == posicion:
      libre = false
      break
      if libre:
      picapica_instanciada = picapica.instantiate() # Instanciamos la animación
      picapica_instanciada.position = posicion # Colocamos la animación en la posición libre
      cambiar.add_child(picapica_instanciada) # Añadimos la animación al nodo Cambiar
      picapica_instanciada.scale = Vector2(1.5, 1.5)
      animaciones_instanciadas.append(picapica_instanciada) # Agregamos la animación a la lista
      break # Salimos del ciclo ya que hemos colocado la animación
      actualizar_visibilidad() # Actualizamos la visibilidad después de instanciar la animación
      func actualizar_visibilidad():
      for i in range(posiciones.size()):
      var posicion = posiciones[i]
      if hay_animacion_en_posicion(posicion):
      mostrar_nodos_vida(i + 1) # Mostrar los nodos correspondientes
      mostrar_boton_posicion(i + 1) # Mostrar el botón correspondiente
      else:
      ocultar_nodos_vida(i + 1) # Ocultar los nodos si no hay animación
      ocultar_boton_posicion(i + 1) # Ocultar el botón correspondiente si no hay animación
      func hay_animacion_en_posicion(posicion: Vector2) -> bool:
      for anim in animaciones_instanciadas:
      if anim.position == posicion:
      return true
      return false
      script , name is DialogScreen
      func _on_si_pressed() -> void:
      Game.activar_picapica() # Llama a la función global que emitirá la señal
      _on_no_pressed() # Esto cierra el diálogo si no se activa picapica
      I want to know if the method of when you press the button called yes from the DialogScreen script works, Game.activate_picapica() is activated, since it is an autoload from the Game script, and with the activate_el_picapica() function from the ui script what it does is a true or false to activate or deactivate (that's what I want), I don't know if it works?

    • @truenincillo805
      @truenincillo805 10 วันที่ผ่านมา

      Hello, I want to know if this method works,
      auto loading script, name Game
      signal activar_picapica_global
      func activar_picapica():
      activar_picapica_global.emit()
      print("Activando picapica")
      script, name is ui
      extends Control
      var picapica_activado : bool = false # Controla si picapica está activado o no
      var picapica_instanciada : Node = null # Para almacenar la instancia de picapica
      @onready var picapica = preload("res://Escenas/ParaEquipo/pika_icon.tscn") # Preload de la escena con la animación
      @onready var posiciones = [
      Vector2(350, 45),
      Vector2(350, 132),
      Vector2(350, 220),
      Vector2(350, 308),
      Vector2(350, 397),
      Vector2(350, 483)
      var animaciones_instanciadas = [] # Para hacer seguimiento de las animaciones instanciadas
      func _ready():
      if Game.is_connected("activar_picapica_global", Callable(self, "activar_el_picapica")) == false:
      Game.connect("activar_picapica_global", Callable(self, "activar_el_picapica"))
      print("Señal conectada correctamente.")
      activar_el_picapica(false)
      func activar_el_picapica(activar: bool = false):
      print("se activo")
      if activar:
      controlar_picapica(true)
      else:
      controlar_picapica(false)
      func controlar_picapica(activar: bool) -> void:
      if activar and not picapica_activado:
      instanciar_animacion() # Instanciamos picapica usando el método ya creado
      picapica_activado = true
      for i in range(1, 7):
      mostrar_nodos_vida(i) # Mostrar los nodos de vida
      mostrar_boton_posicion(i) # Mostrar los botones de posición
      elif not activar and picapica_activado:
      if picapica_instanciada:
      picapica_instanciada.queue_free() # Elimina la animación
      picapica_instanciada = null # Limpia la referencia de la animación
      picapica_activado = false
      for i in range(1, 7):
      ocultar_nodos_vida(i) # Ocultar los nodos de vida
      ocultar_boton_posicion(i) # Ocultar los botones de posición
      actualizar_visibilidad()
      func instanciar_animacion():
      for posicion in posiciones:
      var libre = true
      for anim in animaciones_instanciadas:
      if anim.position == posicion:
      libre = false
      break
      if libre:
      picapica_instanciada = picapica.instantiate() # Instanciamos la animación
      picapica_instanciada.position = posicion # Colocamos la animación en la posición libre
      cambiar.add_child(picapica_instanciada) # Añadimos la animación al nodo Cambiar
      picapica_instanciada.scale = Vector2(1.5, 1.5)
      animaciones_instanciadas.append(picapica_instanciada) # Agregamos la animación a la lista
      break # Salimos del ciclo ya que hemos colocado la animación
      actualizar_visibilidad() # Actualizamos la visibilidad después de instanciar la animación
      func actualizar_visibilidad():
      for i in range(posiciones.size()):
      var posicion = posiciones[i]
      if hay_animacion_en_posicion(posicion):
      mostrar_nodos_vida(i + 1) # Mostrar los nodos correspondientes
      mostrar_boton_posicion(i + 1) # Mostrar el botón correspondiente
      else:
      ocultar_nodos_vida(i + 1) # Ocultar los nodos si no hay animación
      ocultar_boton_posicion(i + 1) # Ocultar el botón correspondiente si no hay animación
      func hay_animacion_en_posicion(posicion: Vector2) -> bool:
      for anim in animaciones_instanciadas:
      if anim.position == posicion:
      return true
      return false
      script , name is DialogScreen
      func _on_si_pressed() -> void:
      Game.activar_picapica() # Llama a la función global que emitirá la señal
      _on_no_pressed() # Esto cierra el diálogo si no se activa picapica
      I want to know if the method of when you press the button called yes from the DialogScreen script works, Game.activate_picapica() is activated, since it is an autoload from the Game script, and with the activate_el_picapica() function from the ui script what it does is a true or false to activate or deactivate (that's what I want), I don't know if it works?

    • @truenincillo805
      @truenincillo805 10 วันที่ผ่านมา

      @@NagiDev Hello, I want to know if this method works,
      auto loading script, name Game
      signal activar_picapica_global
      func activar_picapica():
      activar_picapica_global.emit()
      print("Activando picapica")
      script, name is ui
      extends Control
      var picapica_activado : bool = false # Controla si picapica está activado o no
      var picapica_instanciada : Node = null # Para almacenar la instancia de picapica
      @onready var picapica = preload("res://Escenas/ParaEquipo/pika_icon.tscn") # Preload de la escena con la animación
      @onready var posiciones = [
      Vector2(350, 45),
      Vector2(350, 132),
      Vector2(350, 220),
      Vector2(350, 308),
      Vector2(350, 397),
      Vector2(350, 483)
      var animaciones_instanciadas = [] # Para hacer seguimiento de las animaciones instanciadas
      func _ready():
      if Game.is_connected("activar_picapica_global", Callable(self, "activar_el_picapica")) == false:
      Game.connect("activar_picapica_global", Callable(self, "activar_el_picapica"))
      print("Señal conectada correctamente.")
      activar_el_picapica(false)
      func activar_el_picapica(activar: bool = false):
      print("se activo")
      if activar:
      controlar_picapica(true)
      else:
      controlar_picapica(false)
      func controlar_picapica(activar: bool) -> void:
      if activar and not picapica_activado:
      instanciar_animacion() # Instanciamos picapica usando el método ya creado
      picapica_activado = true
      for i in range(1, 7):
      mostrar_nodos_vida(i) # Mostrar los nodos de vida
      mostrar_boton_posicion(i) # Mostrar los botones de posición
      elif not activar and picapica_activado:
      if picapica_instanciada:
      picapica_instanciada.queue_free() # Elimina la animación
      picapica_instanciada = null # Limpia la referencia de la animación
      picapica_activado = false
      for i in range(1, 7):
      ocultar_nodos_vida(i) # Ocultar los nodos de vida
      ocultar_boton_posicion(i) # Ocultar los botones de posición
      actualizar_visibilidad()
      func instanciar_animacion():
      for posicion in posiciones:
      var libre = true
      for anim in animaciones_instanciadas:
      if anim.position == posicion:
      libre = false
      break
      if libre:
      picapica_instanciada = picapica.instantiate() # Instanciamos la animación
      picapica_instanciada.position = posicion # Colocamos la animación en la posición libre
      cambiar.add_child(picapica_instanciada) # Añadimos la animación al nodo Cambiar
      picapica_instanciada.scale = Vector2(1.5, 1.5)
      animaciones_instanciadas.append(picapica_instanciada) # Agregamos la animación a la lista
      break # Salimos del ciclo ya que hemos colocado la animación
      actualizar_visibilidad() # Actualizamos la visibilidad después de instanciar la animación
      func actualizar_visibilidad():
      for i in range(posiciones.size()):
      var posicion = posiciones[i]
      if hay_animacion_en_posicion(posicion):
      mostrar_nodos_vida(i + 1) # Mostrar los nodos correspondientes
      mostrar_boton_posicion(i + 1) # Mostrar el botón correspondiente
      else:
      ocultar_nodos_vida(i + 1) # Ocultar los nodos si no hay animación
      ocultar_boton_posicion(i + 1) # Ocultar el botón correspondiente si no hay animación
      func hay_animacion_en_posicion(posicion: Vector2) -> bool:
      for anim in animaciones_instanciadas:
      if anim.position == posicion:
      return true
      return false
      script , name is DialogScreen
      func _on_si_pressed() -> void:
      Game.activar_picapica() # Llama a la función global que emitirá la señal
      _on_no_pressed() # Esto cierra el diálogo si no se activa picapica
      I want to know if the method of when you press the button called yes from the DialogScreen script works, Game.activate_picapica() is activated, since it is an autoload from the Game script, and with the activate_el_picapica() function from the ui script what it does is a true or false to activate or deactivate (that's what I want), I don't know if it works?

  • @DevDuckDD
    @DevDuckDD 14 ชั่วโมงที่ผ่านมา

    i want to ask you how you doing that 2d character movement of yourself ? i want to do this too

  • @아프리카남서부마제스
    @아프리카남서부마제스 8 หลายเดือนก่อน +1

    13:25 when make the gamestate?

    • @NagiDev
      @NagiDev  8 หลายเดือนก่อน +1

      Yeah, we made the gamestate autoload in the previous tutorial.

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

      ​ @NagiDev Hey, thanks for the awesome tutorial! Can you share the link of this tutorial? I'm stuck on this part too

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

      @nan0core25 Click on my name under the video to open my channel page, go to the videos tab, and you'll find the video "How to Code Player Health And Fall Damage in Godot 4"
      th-cam.com/video/X6gfjdXckpA/w-d-xo.htmlsi=eWXttE4eFze7ZGxp

  • @mellowmelly9258
    @mellowmelly9258 3 หลายเดือนก่อน

    does the way that one would implement a dialogue box be the same? i.e. would we be able to follow the same steps as the previous tutorial?

    • @NagiDev
      @NagiDev  3 หลายเดือนก่อน

      Pretty much, yeah

  • @nobisstudio8497
    @nobisstudio8497 7 หลายเดือนก่อน +1

    Can show the blue border live player interacting with object

    • @NagiDev
      @NagiDev  7 หลายเดือนก่อน

      Sorry, I don't understand the question

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

    help: Invalid access to property or key 'prompt_message' on a base object of type 'CSGBox3D'.

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

      Your raycast is detecting a CSGBox and trying to get the prompt_message property from it. Enable "show collision shapes" from the debug menu and check if the raycast is detecting another object in the way.

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

      Also, did you skip the condition check in the code? Please check if you skipped some part of the code as that may explain this error.

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

      @@NagiDev Thanks it works

  • @zedritian9500
    @zedritian9500 13 วันที่ผ่านมา

    If I want to have multiple different keys for different doors, how would I do it?

    • @NagiDev
      @NagiDev  13 วันที่ผ่านมา

      If you mean the physical in-game buttons, then just instantiate multiple button scenes, and connect them to the multiple doors, like shown in the tutorial.
      If you mean buttons as in the keyboard buttons, you just have to change the input action for the door/button from the inspector.

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

    I have a quick question: If I wanted to make it so that you had to hold down an action key for a certain amount of time and have a progress bar on the screen that shows how far along the interaction is, how would I go about that?

  • @BreezyDefrag
    @BreezyDefrag 8 หลายเดือนก่อน +1

    Ok, so I am not a code guru or anything so I more just want to ask a question. Couldn't you just use an Enumerator Variable and then just add the code together? Is there a better reason why you use a Custom Class, rather than an Enumerator? And could someone explain what case states would be good for Custom Class VS. Enumerator?

    • @NagiDev
      @NagiDev  8 หลายเดือนก่อน

      To be frank, I'm not that bright myself, so maybe your approach would work just as well, if not better. Can you tell me more about the Enumerator approach a bit?

    • @BreezyDefrag
      @BreezyDefrag 8 หลายเดือนก่อน +1

      @@NagiDev Well with an Enumerator, and I am only touching surface level stuff here as I am still new to coding, but as I understand it you could create an Export Enumerator String Variable with a list of object names then use a Match script in it's own function that will automatically set variables, Names, and Interact buttons, etc. under each match case. Example match string (string Var): "String name": set variables to values. Then you just put that script onto an interactable object which will then show a dropdown in the Inspector. And when you change that Enum String to whatever the object is whether it's a "Button", "Switch", "Key", etc. and each can have it's own functions, calls, and variable sets. under each match state, so you could make the key update a key count var elsewhere, or use the toggle system. This is just a rough breakdown of how I would do this. That's in part why I am asking for some case states for why you would use a custom class over an enum. Hope that makes sense. ^^ Great video though.

    • @NagiDev
      @NagiDev  8 หลายเดือนก่อน +1

      @@BreezyDefrag well, that seems like an interesting way to handle it. However, from my past experiences (read, blunders) I try to steer away from putting all the code in one file. With the custom class, Interactable.gd can have all the code that would be common among all the interactive objects (prompt message, interaction logic, etc),
      while any logic specific to an interactive object can remain in its own script. Say, you want the button to play a press animation when interacted with. That code would only remain in the button's script. Hope you see my point of view.
      And yes, for a very basic use case, the enumerator method seems more easier to make, I'm just trying to make the system capable of being extended and customized.

  • @baraka74
    @baraka74 5 หลายเดือนก่อน

    Great tutorial, if someone can help me out tho, how would I make a door without a button? So u can just interact with the door itself.

    • @NagiDev
      @NagiDev  5 หลายเดือนก่อน +1

      You add an Area3D node to the door scene, and add a CollisionShape to the Area3D. Then attach the interactable.gd script to the Area3D, connect the signals to the door script.
      Boom!
      Profit.

    • @baraka74
      @baraka74 5 หลายเดือนก่อน

      @@NagiDev Ty so much man!

  • @man3d
    @man3d 3 หลายเดือนก่อน

    Hi man!, everything works, but how to do if I want each button to have different sounds? Inheritance with signals breaks the system, and also how to run different streams in the audio player through the code? I'm not really strong in the code so please give me a hint!

    • @casparschoolderman975
      @casparschoolderman975 15 วันที่ผ่านมา +1

      You can make the sound variable exportable so that you can set the sound for each interactable. Just like the messages

  • @queworldwow6262
    @queworldwow6262 5 หลายเดือนก่อน

    I have a question, what can make Raycast3D not rotate with parent object?

    • @NagiDev
      @NagiDev  5 หลายเดือนก่อน +1

      If you don't want to rotate the raycast with the parent, you can set it as top level in the inspector, and then set it's position the same as the parent in the physics process function.

    • @queworldwow6262
      @queworldwow6262 5 หลายเดือนก่อน +1

      @@NagiDev thank you! I fixed it by myself yesterday, turns out my Raycast3D was actually working, it was just inside Area3D and aftwr moving it's origin a little bit away, everything got fixed

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

    So im getting an error after typing
    if collider is interactable:
    Prompt.text = collider.prompt_message
    Its rhe if statements thats not working its giving me a couldnt not parse global class error

    • @NagiDev
      @NagiDev  6 หลายเดือนก่อน +1

      is the class name interactable (with a small i) or Interactable (with a capital I) in your interactable.gd script?

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

      @@NagiDev with a capital I for both

    • @NagiDev
      @NagiDev  6 หลายเดือนก่อน +1

      Are you using capital i in your condition as well?
      If so, have you saved to interactable.gd script?
      Try to save and retry.

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

      @@NagiDev i did but now im having an error with running the game. it works sometimes and other times just refuse to work

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

      can you check your code against the code from the link in the description and see if you missed something?

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

    I am getting an error - 'GameState' not defined.
    Where do i define it?

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

      Gamestate is an autoload we coded in the previous tutorial. You can either watch that or simply copy the code from the link in the description.

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

      Thankyou ​@@NagiDev

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

    mine isnt showing the prompt message, it just says not then [E]

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

      can you please compare your vode with the one from the link in the description and see if you missed something?

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

      @@NagiDev i fixed it, thanks for the response though

  • @kipa_chu
    @kipa_chu 2 หลายเดือนก่อน +1

    amazing, looking for udemy course from you.

    • @NagiDev
      @NagiDev  2 หลายเดือนก่อน

      hehe

  • @Trunalfar
    @Trunalfar 7 หลายเดือนก่อน +1

    Can you give me more videos explaining the buttons in detail in Godot?

    • @NagiDev
      @NagiDev  7 หลายเดือนก่อน

      What parts would you like to know more about?

    • @Trunalfar
      @Trunalfar 7 หลายเดือนก่อน

      @@NagiDev You can teach the necessary knowledge or use in a platform-style game

    • @NagiDev
      @NagiDev  7 หลายเดือนก่อน +1

      I've shared all the necessary information about the button in this video. However, I can understand I didn't explain some of the Godot features thoroughly. You can watch my Godot 3 interaction video for some clarity or there's also plenty of videos on TH-cam explaining Godot raycasts, area3D and signals (3 of the Godot features used in this video).
      But yeah, I plan on making much smaller videos in the future explaining these concepts for beginners. Cheers!

    • @Trunalfar
      @Trunalfar 7 หลายเดือนก่อน

      @@NagiDev Thanks you so much ❤

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

    What if I want to open the door by directly interacting with it?

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

      I mentioned it in another reply, but basically you add an Area3D node to the door scene, add a CollisionShape to it, add the interactable script to the area, and finally connect the signals like in the video.

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

      @@NagiDev Oh, that seems pretty obvious haha I'm so dumb. Thank you so much for the quick reply!

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

      @damnthishandleistaken calling people dumb is not allowed (especially when that person is yourself). You're still learning, it's okay.

  • @gwrgrw4077
    @gwrgrw4077 7 หลายเดือนก่อน +2

    you should make a 3D dialogue tutorial pls

    • @NagiDev
      @NagiDev  7 หลายเดือนก่อน +1

      Already working on that lol

    • @gwrgrw4077
      @gwrgrw4077 7 หลายเดือนก่อน +1

      @@NagiDev thank you I love you nagidev i hope both sides of your pillow are cold tonight

  • @pandapruitt2542
    @pandapruitt2542 3 หลายเดือนก่อน

    Guide is good, I did find that the way you coded game overs did not have anything about setting the players health back to 100 after restarting right? So I went and tested it and unless I missed something that is the case(I probably missed something) soooo just in case you did not notice that then there you go haha, you respawn with essentially 0 hp

    • @NagiDev
      @NagiDev  3 หลายเดือนก่อน

      yup I missed that part lol

  • @Synthverge
    @Synthverge 3 หลายเดือนก่อน

    if i were to interact with a button, how would i go about making it invisible?

    • @NagiDev
      @NagiDev  3 หลายเดือนก่อน

      If you don't want the button to be visible you can just skip the step of adding a mesh to it

    • @Synthverge
      @Synthverge 3 หลายเดือนก่อน

      @@NagiDev i mean, after interacting with it, i want it to go invisible. how exactly would i go about that?

    • @NagiDev
      @NagiDev  3 หลายเดือนก่อน

      To make the button invisible after interaction you can call hide() or $Button.hide() at the end of the _on_interacted() function that is triggered by the interacted signal.
      However the button would still be interactive even after being invisible. To prevent that, you can simply call queue_free() instead of hide() to delete the button after interaction; or you can create a variable to store whether the object is interactive or not and set it to false on interaction.

  • @Anthony_Lara
    @Anthony_Lara 23 วันที่ผ่านมา

    empieza en el 2:40

  • @ThewandererGames0
    @ThewandererGames0 8 หลายเดือนก่อน

    If I only wanted to add the crosshair to the UI part, do I have to add script to the control node?

    • @NagiDev
      @NagiDev  8 หลายเดือนก่อน +2

      If you only want the basic crosshair, you don't really have to add any script.

    • @ThewandererGames0
      @ThewandererGames0 8 หลายเดือนก่อน

      @@NagiDev thanks!

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

    Everything was going well until the 04:31 label was not projected.

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

      Hi! can you please share in detail the issues you're facing?

  • @nettorb_
    @nettorb_ 8 หลายเดือนก่อน +1

    Very nice video, the animations a pretty cool :D
    Btw, when you set in the code to show what button to press, how can I make it show the mouse buttons like LMB or RMB?
    The code shows any other button, but the mouse ones it onlu shows "[]"
    This is the code i'm referring to:
    action.as_text_physical_keycode()

    • @NagiDev
      @NagiDev  8 หลายเดือนก่อน +1

      Heyo! So sorry for the late reply, but I found the solution!
      You should update the code in Interactable.gd like so:
      if action is InputEventKey:
      key_name = action.as_text_physical_keycode()
      break
      elif action is InputEventMouseButton:
      key_name = action.as_text()
      Hope this helps! Also, I'll push this code to the github repo. Thanks for the question!

    • @nettorb_
      @nettorb_ 8 หลายเดือนก่อน +1

      @@NagiDev No problem, thank you so much! that really helps! :D

  • @HappyCucco.
    @HappyCucco. 5 หลายเดือนก่อน +1

    You made a causality dilemma because where do keys come from? And if you need a key to open a chest then where do you get the key to open a locked door? 🤯

    • @NagiDev
      @NagiDev  5 หลายเดือนก่อน +3

      I did not sign up for this 😭

  • @Float212
    @Float212 8 หลายเดือนก่อน +5

    Duuuude where have you beeen?!
    Great video, also, can you do a video about enemy movement and animation?
    If you do I'll subscribe :)

    • @NagiDev
      @NagiDev  8 หลายเดือนก่อน +4

      deal

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

    for some reason my raycast doesn't detect like at all

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

      Enable debug collision shapes from the debug menu and check if the ray cast may be detecting the player body itself. Or maybe you've set the collision layer of the raycast/collision object to some other value?

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

      my bad, i guess i have to make it a child node of the camera so it would go with my screen since i guess that's how I set up my code

  • @547t_gaming
    @547t_gaming หลายเดือนก่อน

    Why does this doesnt work on multiplayer only the host can do this

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

      This tutorial only teaches the actual interaction mechanism. For multiplayer games you would have to manage the interaction state across the host and client depending on how you've structured your project.

    • @547t_gaming
      @547t_gaming 25 วันที่ผ่านมา +1

      ​@@NagiDev i found out how to do it i need to connect it from the script it works now yay

  • @JcommeJeBande
    @JcommeJeBande 2 หลายเดือนก่อน

    where is The ' GameState ' var ?

    • @NagiDev
      @NagiDev  2 หลายเดือนก่อน +1

      Its an autoload script that I created in the previous tutorial.

    • @JcommeJeBande
      @JcommeJeBande 2 หลายเดือนก่อน

      @NagiDev OK thx ( you r so fast wtf 🤣 )

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

    will it be easy to add this a 2d platformer
    great tutorial btw

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

      Yes, you'll have to use 2D variants of the nodes and update the code a bit and it should work.

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

    "This is gonna be a long one" ... 16 min 😂😂

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

      It took me a long time to edit 😭😭

  • @alambogamer4204
    @alambogamer4204 5 หลายเดือนก่อน

    Is anyone else unable to find the "Interacted" signal?

    • @NagiDev
      @NagiDev  5 หลายเดือนก่อน

      This could be due to a few reasons:
      - you might've forgotten to define it in the interactable.gd script
      - maybe you named the signal differently in the script
      - maybe the script if not attached to the node
      - maybe you haven't saved the script yet, so the signal is not showing up in the inspector
      Please let me know if I can help, I'd be happy to do so

    • @alambogamer4204
      @alambogamer4204 5 หลายเดือนก่อน

      Oh wow, I found the fix. I overlooked 8:04... Sorry about that. Thank you so much for your help tho! you are def unrated!

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

    a little too fast for me i 'll just to watch it a few times. but seems really info

  • @quiet5445
    @quiet5445 7 หลายเดือนก่อน

    bro where are u are u dead ???

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

    6 months!! has he forgotten that he has to complete the game ?

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

      I'm trying 😭

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

      @@NagiDev np bro you probably busy with other stuff hope so next vid will be soon and Fantastic 🤙
      edit:- please cover these topics - Sprint & stamina, enemy & Npc, it would be helpful

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

      @Husk947 I'm working on NPC tutorial rn lol!

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

      @@NagiDev maybe i saw a npc interaction in old godot 3 interaction tutorial so if you can make tutorial on enemy would be more important ig although npc is also cool

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

    hey bro, can you make a graph edit and graph node tutorial, because I have an idea to make a game engine with godot with visual script as the script component.

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

  • @quiet5445
    @quiet5445 7 หลายเดือนก่อน +1

    bro i wanna say it still feels kinda with all of this much and stuff in scene can u please make a simplified vedio for this again just implementing these systems simple scene altho it seems really goodd for future proof but as a beginner its hard pleaseeeeeee make easy and simplified one 🥲🙏🙏🙏🙏

    • @NagiDev
      @NagiDev  7 หลายเดือนก่อน

      Sure. Can you share which parts were hard to understand?

    • @quiet5445
      @quiet5445 7 หลายเดือนก่อน +1

      @@NagiDev i wont say the whole vedio but for me the whole part for adding functinallity to button were difficult cuse according to me there was so much going on i could wrap my head around most of the things thats why i need a simplified verison and yeaaa overallllll great vedioooooo will ceratinly help me in future also can u make a simplified version for pickables stuff like torch will be gratefull for that 🥲🙏

    • @NagiDev
      @NagiDev  7 หลายเดือนก่อน

      @quiet5445 ah got it. So the thing is, you can define custom signals in a script which shows up in the node tab (beside the inspector) when you have the node with that script selected. In this video I created a custom signal "interacted" and connected it through the node tab to various functions in other scripts. So for example,
      button (Interactable.gd) -> interacted signal -> do_something() (function)
      Basically when the interactRay interacts with an Interactable node, the node emits the interacted signal, this signal can be connected to any number of functions in any script. So, when the interacted signal is emitted by that node, all the connected functions are called, and we can put the code we want to run inside these functions like we did in the video.
      I hope this helps you understand what's going on in the interaction system. If you still have doubts, feel free to contact me over at Discord @nagidev. Also, I would suggest you to learn more about Godot signals since they are really powerful for all sorts of things.

    • @quiet5445
      @quiet5445 7 หลายเดือนก่อน +1

      @@NagiDev thanku very much im just starting on this 3d project and your tutorial be of so much of help as there arent much tutorial on godot 4 on top of that you might not find what youre looking for altho interaction isnt that specific but still there isnt any vedio on youtube other than u that actually helped plus your the only one that replies tbh since getting replies from youtube channels nowdays is next to impossible until unless you comment on a recent vedio surely i would follow u on discord

    • @Papajoofable
      @Papajoofable 5 หลายเดือนก่อน

      Hi bro, your videos are really cool, I can see how much you put into each of them. I would like to ask you about shapecast nodes, what get_collider index does ask for? I really need help😢