How to make interactable objects in Godot!

preview_player
Показать описание
Hey everyone!
In this video, I'll show you how to create your own interaction system in the Godot game engine!
Watch until the end to find out how you can use this system to interact with objects, items, and NPCs in your Godot game!

Thanks for watching, hope you have a great week!

LINKS:
-------------------------------------

GitHub Project:

Need help with your Godot project?:
-------------------------------------

CREDITS:
-------------------------------------
-------------------------------------

TIMESTAMPS:
-------------------------------------
0:00 Intro
0:13 Initial Project Setup
0:54 Creating the Interactable Object
2:32 Creating the Interacting Component
9:32 How to use the Interacting Component
9:46 How to use the Interactable Object
11:48 Showcase
12:23 Outro, thanks for watching! :)
-------------------------------------

Join this channel to get access to perks:

Рекомендации по теме
Комментарии
Автор

I like how open and modular this system is.

ZiranmenBerlin
Автор

Your tutorials are very polished. Please keep making more videos like this.

SW-vyhe
Автор

YouTube has recently decided that it's going to deliver me some of the most helpful Godot tutorials from channels I've never watched before. Thanks!

toolazytobeoriginal
Автор

wonderfully short and concise code, love it!

Pallerim
Автор

Man really great job! Please keep doing these tutorials, you are a hobby saver!

beatingdeadhorsesbacktolif
Автор

I want to rip my hair out haha, I followed your older tutorial on interaction and had it working (but I wanted more than just floating text, I wanted to trigger dialogue bubbles too), so I tried this one and now its broken the stuff I already had working 😵‍💫 Ive only been learning godot for a couple days but man is it frustratingly hard to get started...

lorekeepermeerah
Автор

You are the best ! So simple and effective, just perfect !
Thank you so much for all your videos !

anthonythibodeau
Автор

I ran into an issue where setting is_interactable to false just makes the label not show, but the object can still be interacted with. I fixed this by changing the input event to

If current_interactions and


I’m sure there’s a better way to do this, or maybe I missed a step. But in case I didn’t, thought I’d help.

Stromhammar
Автор

I like how your video. Very details and easy to understand

shukhambalie
Автор

Very helpful indeed! Thanks a lot mate

maxever
Автор

First, This is SO GOOD! thank you! second do you have a link to the start of this tutorial? i get you have it split but i would love to see how you wet up your level map and collision for the tile set, amount other things like creating and adding the chest to the map.

I am getting back into coding after 20 years so i a VERY rust on it all and new to godot in general.

simulatedfish
Автор

Hey, thank you so much for the tutorial. I don't think I could have made it as far as I did so far without it, but I do have a problem with it. Whenever I boot the game up, the interactable part of this system comes up with an error (specifically around the "interactable.interact = _on_interact" part) that says: "Invalid assignment of property or key 'interact' with value or type 'callable' on a base project of type 'null instance'" If, by absolutely any chance, you've seen someone with this error before, do you know how to fix it? Thanks!

theloldog
Автор

Hello thanks for the tutorial, but something is not works when you put in the script of the treasure chest
"if sprite_2d.frame == 0:
sprite_2d.frame = 1 "
I still dont know, if you are using Sprite2d or AnimatedSprite2D to open the chest with animation in the video. please i hope you can respond me and solve this situation.

deltaruness
Автор

followed tutorial all the way to the end but ended up getting a bunch of errors dont know if the new version bricked it but was not able to get working?

danobano
Автор

Awesome approach to this! Currently away from my project for a few weeks, so I can’t test this out but I have a question:

If I wanted an intractable object to change scenes (say go to the next level for example), line 13 of the interacting_component script

Await

I imagine would return null and throw an error, no? If so could you share any thoughts on how to approach this? I’m still relatively new to programming in general so all help is appreciated :) thanks again!

anonymous
Автор

I followed the tutorial and it works SO WELL, but I have run into a problem with the area. At any time I press the key to interact, despite being far from the interaction area I created, it will trigger the interaction. I don't know what I did wrong, I followed everything perfectly. I'm thinking it might have something to do with the fact that I have worked in the project before I added this code, but I never added any area coding, all I added was some controls for the player. Please see if you can help me out.

SomebodyUnamed
Автор

Hi! Very nice tutorial! I just happened to have a question. in case i have a NPC, and i want to have more than 1 interaction, what is advisable? I was thinking of having them in the dialogue options (talk, trade, duel), but another state came to mind: let's say I have an unconscious or dead NPC on the ground, and I want the player to be able to loot the body or to pickup the body, what is a good idea?

I was thinking about having "Interactable" hold an array of "interact" functions, and making my npc define each interaction. Maybe make an interaction a Resource so it can be reused?

yawarapuyurak
Автор

please make a video on how to make a 3d interactable object. I have a 3d wargame I'm making and I have hexagonal prisms that you select to perform actions in and im trying to translate this to 3d but idk if it'll work.

mineterragaming
Автор

How would you deal with saving if an object has been interacted with? (for a save file or going back to a map later?) Would you use save the game/level state to a resource or a global etc?

flailmusic
Автор

I have a question. In this case, how could you set two Treasure Chest with different items?

Yosef-rj
visit shbcf.ru