# SetSelectedOption(int)

Method in [Dialogue](/2.3/api/csharp/yarn/yarn.dialogue.md)

## Summary

Signals to the [Dialogue](/2.3/api/csharp/yarn/yarn.dialogue.md) that the user has selected a specified [Option](/2.3/api/csharp/yarn/yarn.optionset/yarn.optionset.option.md) .

```csharp
public void SetSelectedOption(int selectedOptionID)
```

## Remarks

After the Dialogue delivers an [OptionSet](/2.3/api/csharp/yarn/yarn.optionset.md), this method must be called before [Continue()](/2.3/api/csharp/yarn/yarn.dialogue/yarn.dialogue.continue.md) is called.

The ID number that should be passed as the parameter to this method should be the [ID](/2.3/api/csharp/yarn/yarn.optionset/yarn.optionset.option/yarn.optionset.option.id.md) field in the [Option](/2.3/api/csharp/yarn/yarn.optionset/yarn.optionset.option.md) that represents the user's selection.

## Parameters

| Name                   | Description                                         |
| ---------------------- | --------------------------------------------------- |
| `int` selectedOptionID | The ID number of the Option that the user selected. |

## See Also

* [OptionsHandler](/2.3/api/csharp/yarn/yarn.optionshandler.md): Represents the method that is called when the Dialogue delivers an [OptionSet](/2.3/api/csharp/yarn/yarn.optionset.md) .
* [OptionSet](/2.3/api/csharp/yarn/yarn.optionset.md): A set of [Option](/2.3/api/csharp/yarn/yarn.optionset/yarn.optionset.option.md) s, sent from the [Dialogue](/2.3/api/csharp/yarn/yarn.dialogue.md) to the game.
* [Dialogue.Continue()](/2.3/api/csharp/yarn/yarn.dialogue/yarn.dialogue.continue.md): Starts, or continues, execution of the current Program.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.yarnspinner.dev/2.3/api/csharp/yarn/yarn.dialogue/yarn.dialogue.setselectedoption.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
