Hi again. I have been following the quick start tutorial and have a bit of an issue modifying it so that the conversation is triggered only when the player is within certain range from the npc. What I have now is
1 player with selector script attached. It also has the "distance from" set to "game object". Also I set the "actor transform" to the player's one.
1 NPC with Dialogue system trigger and Usable scripts.
I assumed that by checking the "distance from" to "game object" the conversation will trigger only when the player is within range, but what I get is the same functionality as before. If the camera is within the specified range then the conversation triggers.
I know I can put a proximity selector, but then I would have to be adjusting trigger colliders of each NPC.
Selector distance from game object
Re: Selector distance from game object
Hi,
Distance From = GameObject checks the distance from the Selector's GameObject to the Usable. Here's a patch that adds the option Distance From = Actor Transform:
DS_SelectorPatch_2021-07-22.unitypackage
This addition will also be in the next full release (2.2.19).
Distance From = GameObject checks the distance from the Selector's GameObject to the Usable. Here's a patch that adds the option Distance From = Actor Transform:
DS_SelectorPatch_2021-07-22.unitypackage
This addition will also be in the next full release (2.2.19).
-
- Posts: 41
- Joined: Mon Jul 19, 2021 11:27 am
Re: Selector distance from game object
Hmm so I was correct in thinking it tracks the selectors gameobject... Weird that it still tracked the camera distance and not the gameobject. Btw does it work as expected on your machine ?
Even after I implemented the patch it still tracks the camera position. Though I did had 3 errors after importing it. I commented out those 3 lines and tested it then.
Even after I implemented the patch it still tracks the camera position. Though I did had 3 errors after importing it. I commented out those 3 lines and tested it then.
Re: Selector distance from game object
Hi,
Are you perhaps using an old version of the Dialogue System? If so, can you back up your project, update to the current version, and then import the patch?
If you set Distance From to Actor Transform, then if the raycast hits a Usable it will compute the distance between the Usable and the Actor Transform. (However, the raycast itself always runs from the camera to the Select At position.)
Are you perhaps using an old version of the Dialogue System? If so, can you back up your project, update to the current version, and then import the patch?
If you set Distance From to Actor Transform, then if the raycast hits a Usable it will compute the distance between the Usable and the Actor Transform. (However, the raycast itself always runs from the camera to the Select At position.)
-
- Posts: 41
- Joined: Mon Jul 19, 2021 11:27 am
Re: Selector distance from game object
Ohhh I am a dumb dumb xD updated everything, tried your script and even created new project and started testing there..
I thought selector distance was the distance from character to NPC, but it is actually the max range the raycast will run from the camera to the mouse... And the max use distance is what I was looking for.
Anyway thanks for the help and sry for bothering you. In any case your plugin has one of the best support from all the unity assets out there.
I thought selector distance was the distance from character to NPC, but it is actually the max range the raycast will run from the camera to the mouse... And the max use distance is what I was looking for.
Anyway thanks for the help and sry for bothering you. In any case your plugin has one of the best support from all the unity assets out there.
Re: Selector distance from game object
Thanks! I'm glad you got to the bottom of the issue.