Hi there,
I am having a problem with the Conversation Trigger Distance. I have a capsule collider on my NPC and have set the range to where I want it to trigger however the conversation gets started well beyond the range of the collider.
Is there a place somewhere that you can define the distance of the conversation trigger?
Thanks
Dean
Conversation Trigger Distance?
Re: Conversation Trigger Distance?
Hi,
If you're using a Conversation Trigger that's set to OnTriggerEnter, it will attempt to start whenever Unity sends it an OnTriggerEnter message. Unity will send this message whenever the Conversation Trigger's GameObject is involved in a collision with a trigger collider. Typically, to set up a Conversation Trigger with OnTriggerEnter, you'll add an additional collider, such as a sphere collider, and tick the Is Trigger checkbox. To set the range at which it detects collisions, adjust the size of this trigger collider.
Please note that, by default, the Conversation Trigger will respond to any OnTriggerEnter message, not just the player. So if another collider, such as a rock on the ground, collides with the NPC, Unity will send an OnTriggerEnter message. If you want to restrict it to only start a conversation if the player enters the trigger collider, expand Condition > Accepted Tags and add the tag "Player" (without quotes). This assumes your player is tagged "Player".
When a conversation starts, you can reposition the camera to do a closeup of the NPC by setting the first dialogue entry node's Sequence field to something like:
This moves the camera over 1 second into a closeup of the speaker (the NPC). It also waits for a duration based on the length of the NPC's dialogue text.
If I completely misunderstood you, and if you're talking about the distance using the Selector component or something like that, please let me know.
If you're using a Conversation Trigger that's set to OnTriggerEnter, it will attempt to start whenever Unity sends it an OnTriggerEnter message. Unity will send this message whenever the Conversation Trigger's GameObject is involved in a collision with a trigger collider. Typically, to set up a Conversation Trigger with OnTriggerEnter, you'll add an additional collider, such as a sphere collider, and tick the Is Trigger checkbox. To set the range at which it detects collisions, adjust the size of this trigger collider.
Please note that, by default, the Conversation Trigger will respond to any OnTriggerEnter message, not just the player. So if another collider, such as a rock on the ground, collides with the NPC, Unity will send an OnTriggerEnter message. If you want to restrict it to only start a conversation if the player enters the trigger collider, expand Condition > Accepted Tags and add the tag "Player" (without quotes). This assumes your player is tagged "Player".
When a conversation starts, you can reposition the camera to do a closeup of the NPC by setting the first dialogue entry node's Sequence field to something like:
Code: Select all
Camera(Closeup,,1);
Delay({{end}})
If I completely misunderstood you, and if you're talking about the distance using the Selector component or something like that, please let me know.
Re: Conversation Trigger Distance?
Thanks Tony,
You were spot on, I worked it out though... Inventory Pro was adding a sphere collider to my player at run-time and I had the default radius set to 10, adjusted to 2.5 and works perfectly now
Appreciate the reply.
Regards,
Dean
You were spot on, I worked it out though... Inventory Pro was adding a sphere collider to my player at run-time and I had the default radius set to 10, adjusted to 2.5 and works perfectly now
Appreciate the reply.
Regards,
Dean
Re: Conversation Trigger Distance?
Ah, sneaky Inventory Pro!