[beginner question] Ink in unity, can't get variable
- Dominant language
- C#
- Stars
- 4.9k
- Forks
- 540
- PR merge metrics
- No merged PRs in 30d
Description
Hello, I'm having some problems with getting variables from a .ink file in unity. The player through a dialog can choose if leaving the level and then with a script I load the scene if the player chose to leave.
Here's the .ink
```
VAR exit=0 //1:yes 0:no
Should I leave?
*[Yes]
~exit=1
->END
*[No]
~exit=0
->END
```
and with this script I check what the player has chosen
```
[SerializeField]
TextAsset ext_level_asset;
public Story ext_level_story;
int exit_level;
private void Awake()
{
ext_level_story = new Story(ext_level_asset.text);
}
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
exit_level = (int)ext_level_story.variablesState["exit"];
}
```
The problem is that it seems to completely ignore the part in the update, and when I try to change it through the inspector it goes back to 0. How can I solve it?
Thank you very much.
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.