hi, I am kinda new to unity.
So I need a conversation system where the player can answer questions that I give with either “yes” or “no”.
and the yes or no questions need to have different outcomes.for example:
yes: Ok, so blah blah blah
is this thing on?
no: wait how can you answer this then
and then these questions need to have multiple outcomes,
but I can’t seem to figure this out.
What have you tried?
You could look into asset store.
This sounds like it could be done using ScriptableObjects.
public class DialogueObject : ScriptableObject
{
[SerializeField]
private string text;
[SerializeField]
private DialogueChoice[] dialogueChoices = {};
public string Text => text;
public DialogueChoice[] DialogueChoices => dialogueChoices;
}
[Serializable]
public class DialogueChoice
{
[SerializeField]
private string choice;
[SerializeField]
private DialogueObject proceedingDialogue;
public string ChoiceText => choice;
public DialogueObject ProceedingDialogue => proceedingDialogue;
}
Despite how simple it may seem when thought of from screen to screen, having a branching dialogue system is no easy task. Even more so for branching outcomes. For more complex implementations, a node graph is pretty much a necessity. Having the nodes affect objects in your scene will be part 2 of the problem. If you have no experience with editor scripting, it will be far easier for you to pick up an asset that lists the features you want.
ok i looked around a bit on the asset store and found: Fluent Dialogue | GUI Tools | Unity Asset Store
it looks like it can do what i need
Looks like how you’d do stuff in Ren’py, which is a game engine completely dedicated to making visual novels. Not exclusively of course, other creators have made rather impressive things with it, but pure conversation is what Ren’py excels at. Ren’py doesn’t extend itself into 3D, and is script heavy. Other than that, if all you’re looking to make is a 2D decision making game, I’d suggest Ren’py as a popular lightweight alternative.