I want to set up a simple system where the player faces towards an object that they want to interact with, and if it has dialogue, it will trigger that dialogue when the interact button is pressed.
I tried using the Selector setup, but for some reason it seems to only work when the object is directly above the player object. Any insight in how to simply look directly in front of where the player is facing for a certain range and interact with that object?
Find an Interactable Target in front of Player Object
-
- Posts: 2
- Joined: Thu May 24, 2018 7:56 pm
Re: Find an Interactable Target in front of Player Object
Hi,
Add a Proximity Selector and a trigger collider to the player GameObject. Position the trigger collider in front of the player.
Add a regular collider, a Usable component, and a Conversation Trigger (or Dialogue System Trigger) to the NPC.
If that doesn't do the trick, please let me know whether this is 2D or 3D, and the camera perspective (e.g., 2D topdown, 2D platformer, 3D over the shoulder, etc.).
Add a Proximity Selector and a trigger collider to the player GameObject. Position the trigger collider in front of the player.
Add a regular collider, a Usable component, and a Conversation Trigger (or Dialogue System Trigger) to the NPC.
If that doesn't do the trick, please let me know whether this is 2D or 3D, and the camera perspective (e.g., 2D topdown, 2D platformer, 3D over the shoulder, etc.).
-
- Posts: 2
- Joined: Thu May 24, 2018 7:56 pm
Re: Find an Interactable Target in front of Player Object
Great, that worked perfectly, thanks!
This was for a fixed camera in a 3D environment, with an isometric-style camera angle, in case someone needs that for reference.
This was for a fixed camera in a 3D environment, with an isometric-style camera angle, in case someone needs that for reference.