How to make player and npc interaction?
Hello,
I have an isometric game (3D mode). It has 3D world and 2d characters (2d sprites). Player is controlled by keyboard and NPC are NavMeshAgents and they walking by some generated path. I need to make player to be able to interact with any NPC in certain radius (say still from NPC or kill it). Also i need others NPC to see this interaction (say if they so i steel they should call for a guards).
I am pretty new to a unity and i am not sure that is proper way to make it. Could you give me some advices or may be links to some tutorials? I tried to google it but it all about dialogs and that not the thing i looking for.
Thanks forward.
You can try adding another collider to your npc's, and make them triggers. Then make the collider go around the npc, and if the player goes in the region have a script attached to your collider checking if it is the player. If it is then have it do what you want to do. Let me know if this helped, or if want an example script.
Your answer
Follow this Question
Related Questions
Unity 3D #C Nightvision does not want to switch on or off. 0 Answers
Avoid using GetComponent to check if RayCast hit is interactable 0 Answers
Mining from a chunk? - 3d Game Cavern Generation + Player integration 0 Answers
Door disappearing problem Unity 5.3 3D. 1 Answer
Unty 3D C# Load other scene when bool = true, otherwise perform teleportation as commanded. 1 Answer