How to Talk to NPCs! (or Interact with any Object, Open Doors, Push Buttons, Unity Tutorial)

How to Talk to NPCs! (or Interact with any Object, Open Doors, Push Buttons, Unity Tutorial)

Code Monkey

1 год назад

95,402 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

Khurum Khan
Khurum Khan - 26.09.2023 14:03

can you make a video of an interactable using unity events

Ответить
Doxyfeathers
Doxyfeathers - 24.09.2023 17:10

The npc interact isnt working it spews out this error
Assets\PlayerInteract.cs(13,50): error CS0246: The type or namespace name 'NPCIneractable' could not be found (are you missing a using directive or an assembly reference?)

HELP ME CODEMONKEY I KNOW YOU ARE RELIABLE I HAVE A PROJECT DUE IN 2 DAYS!!!

Ответить
JodiCreative
JodiCreative - 23.09.2023 17:08

Thank you!!

Ответить
Dragan Kordić
Dragan Kordić - 16.09.2023 10:34

I remembered what you remind me of when I work with you, when I follow your "lecture" it's the same for me as when I try to work with "chatgpt", I spend several hours and in the end I'm frustrated, while "chatgpt" is confident in its skills and he just wishes me luck in the next project and he's sorry he didn't help me and if I need help to contact him. I'm also amazed with the amount of time spent and nothing achieved. I had to say it ,because now as I watched this again video, this "lecture" gave me exactly the same feeling as when I spent with "chatgpt"

Ответить
Dragan Kordić
Dragan Kordić - 15.09.2023 17:58

6.30m- Please answer me. How to apply that chat bubble that you made in 2D and now use it for 3D? in order to be able to see the text in the game, I have to put that text in 3D on the canvas that is set in world-space. however the text does not change at all. I do not understand? And according to you, the word after each setting for you is - simple. And as I said in one of the previous comments, nothing is simple for me when watching your videos. you are totally complicating it. Can you please explain 2d chatbubble 3d chatbubble?

Ответить
apples10
apples10 - 09.09.2023 16:08

Sorry I still don't understand how the interface mehthods work? I have watched your video on interfaces and I understand that. So how does it work like if you have 5 different food objects that you can pick up or place down? How does the interface code work?

Ответить
Ha7an Ali
Ha7an Ali - 08.09.2023 08:00

The Video Was Quite Useful thanks , but why can't we use SphereCast Or RayCast System ?? like that Works Fine I guess

Ответить
JUDA
JUDA - 09.08.2023 17:18

loooooooooooooooooooooooooooooove you

Ответить
TPpro#1
TPpro#1 - 03.08.2023 19:25

I need the script pls

Ответить
ISavic
ISavic - 12.06.2023 12:33

Interfaces are cool, but you are still pasting the same code for interface methods to every class that implements it. If some method has to be changed, you need to paste the code again. What would be the way around this?

Ответить
Brett Beacon
Brett Beacon - 21.05.2023 12:14

Hey, How do you get the lerping to work every time? it lerps the animation on the first interaction, however, after that, the head snaps to the position, should i be setting the lookAtPosition to false after it looks at the player?

Ответить
WS Project
WS Project - 15.04.2023 15:15

Well, We created IInteractable made an abstraction between. But still we have unnecessary Transform parameter inside Button & Door. What if we need 2 parameters inside an interactable, are we going to extend that Interact function inside IInteractable? How would you approach to that

Ответить
WS Project
WS Project - 15.04.2023 14:26

How could we do that with two-sided? For example, we have different interactable objects & but our character will react differently for every object he interacts. Should i pass Interactor inside Interact method in Interactable, and reach the methods like; OnInteractPolice(); inside Interactor?

This means we have to create all the methods for every interaction we do right? How would approach to that problem; We interact different objects, our character reacts different every object it interacts.

Ответить
azmi tahir
azmi tahir - 05.04.2023 08:01

could you go indepth with chatbubble3d?

Ответить
michael chou
michael chou - 22.03.2023 19:05

Hey!CodeMonkey,I got a question,how to make two NPC say different things?

Ответить
The Derbly
The Derbly - 18.03.2023 11:28

Can you make a tutorial for how to make an npc walk in random directions?

Ответить
lazytocook
lazytocook - 17.03.2023 14:02

your voice and the way u talk makes me smile.

Ответить
Nezhio Evangelion
Nezhio Evangelion - 16.03.2023 19:46

Greetings, Code Monkey. I have a question, is the ChatBubble3D needs to be imported to the project as it was made in your previous video?

Ответить
S-ata-N
S-ata-N - 16.03.2023 14:28

Is using Physics.Raycast() any better? Performance and reliability wise.

Ответить
Gabriele Cicconetti
Gabriele Cicconetti - 21.02.2023 11:27

Can i use OnTriggerEnter to detect the collision or is it bad?? <3

Ответить
Slow Down Cooking
Slow Down Cooking - 20.02.2023 16:25

Please add subtitles if you can. Thank you for the wonderful video. :)

Ответить
H0R1ZZON
H0R1ZZON - 19.02.2023 15:44

I use mixamo and fuse for free models and animations

Ответить
Bourbon
Bourbon - 16.02.2023 16:31

Hey Man, Lovin the tutorial so far, have learnt alot about different function in code. However ive ran into a small issue, i cannot get any console output of displaying the colliders in a scene and getting the "Interact!" message to appear in the console. ive been following this tutorial for buttons do u possibly know why?

Ответить
Luc1dity
Luc1dity - 06.02.2023 09:17

Hi I'm in the NPC Interact part of the lecture and I ended up getting the error:
error CS0246: The type or namespace name 'NPCInteractable' could not be found (are you missing a using directive or an assembly reference?)

this is my code:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class PlayerInteract : MonoBehaviour
{
private void Update()
{ if (Input.GetKeyDown(KeyCode.E))
{
float interactRange = 2f;
Collider[] colliderArray = Physics.OverlapSphere(transform.position, interactRange);
foreach (Collider collider in colliderArray)
{
if (collider.TryGetComponent(out NPCInteractable npcInteractable))
{
npcInteractable.Interact();
}
}
}
}
}

Ответить
Paul
Paul - 05.02.2023 04:10

I wouldnt use this tutorial , its all over the place using a 2d chat bubble from another video

Ответить
라비에옹 rian B
라비에옹 rian B - 28.01.2023 22:41

I made new project on 3d but when i put package it's all pink :(

Ответить
Max Miller
Max Miller - 20.01.2023 22:10

what is more performant: running something like Physics.OverlapSphere in update, or to have an instantiated, invisible, sphere gameobject checking collision?

Ответить
Ukroadman
Ukroadman - 18.01.2023 19:23

for me it says NPCInteractable could not be found am i missing something? cause im pretty sure i followed the tutorial correctly

Ответить
Bismo Funyuns
Bismo Funyuns - 16.01.2023 20:31

Thanks!

Ответить
FERNANDAOVERSE
FERNANDAOVERSE - 04.12.2022 03:45

I really like your No code Course in Unity, you could create new one with updates and maybe new genres if you have time in the future, I would 100% buy it!

Ответить
Ghost_Grrl
Ghost_Grrl - 03.12.2022 19:14

Any chance we could get a tutorial for this using the new input system??

Ответить
BANTO
BANTO - 27.11.2022 12:20

Thank you so much, this will be super helpful for our project. Is it okay if we use parts of this code in our project, its for a school project?
Have a wonderful day and thanks for everything you do for the community!

Ответить
Atanas Spasov
Atanas Spasov - 01.11.2022 19:41

I love you Code Monkey

Ответить
KB 4 JC
KB 4 JC - 24.10.2022 20:51

Code monkey I appreciate your work please and please their lots of videos on making multiplayer lobby, in game inventory and shop system.
But if you try to search for shop system for multiplayer in start menu there's non like I don't want to make RPG I just wanna make a game where my players are able to buy characters (cars) and enter game with that character (car) but I don't how to please make a tutorial about it I'm making a multiplayer car race game I want players to buy cars and equip it then enter game with it, please (using netcode or photon)

Ответить
Abdoul raouf Gambo
Abdoul raouf Gambo - 22.10.2022 20:41

This tutorial is awesome !!!!!🤘🤘🤘

Ответить
Marsal
Marsal - 15.10.2022 21:44

wouldn't using a short range raycast and then checking for collider boxes be more effective?

Ответить
Ибрагим Иванов
Ибрагим Иванов - 15.10.2022 14:35

Better to add a check for the camera frustum, just to eliminate the cases when objects are behind.

Ответить
badscotsman
badscotsman - 15.10.2022 13:44

I notice you're not hiding the interaction prompt - (E) Talk with Alice - when the key is pressed. I'm assuming that will be somewhat difficult since you're using Update() to keep it showing in the first place... but hiding it when the key is pressed would be the typical UI response you see in most every game.

I love how you showed the refactor for using an Interface then... that was a great learning opportunity for those unfamiliar with them to see the resulting value.

Ответить
Burak YIGITGULSUN
Burak YIGITGULSUN - 15.10.2022 12:34

I want to get an opinion on a topic. Should I use serializefield or find method to access multiple gameobjects?

Ответить
Mason G.
Mason G. - 15.10.2022 03:35

Is there a reason to use physics overlap instead of attaching a trigger to the player?

Ответить
Anton Orlov
Anton Orlov - 14.10.2022 16:36

Cool theme for tutorial! Thank you again!
Did you think, what would be if you need to pass more parameters to the IIneractable.Interact method, rather than the only Transform parameter? For example, if different types of interactables has it's own set of parameters, that they need in Ineract method? Generally seaking, you are already have DoorInteractable and ButtonInteractable, that needs a different set of parameters in Interact method - they both needs no parameters, but Transform is there.. a little bit confusing, because Door and Button become dependent of what they are don't need at all.

Ответить
jud.Su.5 developer
jud.Su.5 developer - 14.10.2022 08:01

😱🤯🤯🤯🤯🤯🤯😱😱

Ответить