Hey,
So I've been playing around with the Dialogue System, and I understand that the Triggers provided such as (onTriggerEnter, OnUse etc.) make triggering the dialogue easy and intuitive.
I was wondering if it was beneficial to write my own Custom Collider, for example for my game, instead of using BoxCollider2d I have my own logic in place that finds the nearest gameObj
The reason for this is because I found in previous projects BoxColliders can be pretty limiting and I wanted to find a new solution.
In the script I would play the bark or conversation, by calling the StartConversation() or BarkString() function
Doing these simple operations seem easy enough. Looking forward though, I realized I might need to account for multiple variables such as LuaConditions, QuestConditions etc.
Sorry for the long explanation, I guess my questions are:
1. )Is there an easy way to check if conditions are passed or failed that I can reference in a script?
2.)Is it just better to use a BoxCollider since it seems there's a lot of dependencies in the Dialogue System that requires the component?
Cheers
Is it better to use BoxColliders or Custom Scripts with Dialogue System
-
- Posts: 10
- Joined: Wed Apr 27, 2022 11:01 pm
Re: Is it better to use BoxColliders or Custom Scripts with Dialogue System
Hi,
Nothing in the Dialogue System specifically requires a BoxCollider or BoxCollider2D. The Proximity Selector component and Dialogue System Trigger components that are set to OnTrigger/CollisionEnter/Exit require some kind of collider, of course, but that's because they rely on collisions.
You could add a Dialogue System Trigger to a GameObject (e.g., NPC), set it to OnUse, and set up Conditions and Actions. Then your custom interaction system can use it. Example:
Nothing in the Dialogue System specifically requires a BoxCollider or BoxCollider2D. The Proximity Selector component and Dialogue System Trigger components that are set to OnTrigger/CollisionEnter/Exit require some kind of collider, of course, but that's because they rely on collisions.
You could add a Dialogue System Trigger to a GameObject (e.g., NPC), set it to OnUse, and set up Conditions and Actions. Then your custom interaction system can use it. Example:
Code: Select all
private void Interact(GameObject player)
{
foreach (var ds in GetComponent<DialogueSystemTrigger>())
{
ds.OnUse(player.transform);
}
}
-
- Posts: 10
- Joined: Wed Apr 27, 2022 11:01 pm
Re: Is it better to use BoxColliders or Custom Scripts with Dialogue System
Man, it's beyond me how you can read through my question and come up with the perfect response.
Thanks man, I appreciate! OnUse really coming in clutch haha
Thanks man, I appreciate! OnUse really coming in clutch haha