inkle / inkle/ink

Missing Types in Value.cs

Open
#570 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
C#
Stars
4.9k
Forks
540
PR merge metrics
No merged PRs in 30d

Description

This is an issue that arises when assigning values to the global variable state from code in Unity.
I was getting the following error when trying to assign values in the variable state to zero: `StoryException: Invalid value passed to VariableState: 0`
I noticed that it only occurred when I tried to assign it to uint zero, but not int zero. After some digging I found that uint isn't included in the type checks in `Runtime.Value.Create`. I'm just casting to int for now, but it would be great to have uints included in the type checks.
**TLDR**
Works: `story.variablesState["myVar"] = (int)1;`
Doesn't work: `story.variablesState["myVar"] = (uint)1;`

Thank you for all your work, I love Ink!

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.