Using variables values from Yarn Spinner
So, I'm not a programmer and I've started using Yarn Spinner a couple of weeks ago.
I've been trying to get the values from the variables declared in the .yarn files in order to set a couple of game objects as active or inactive, but I haven't been able to make it work yet.
I've found this and managed to get to this point so far:
public class LyreController : MonoBehaviour { public GameObject lyreStringOne; private InMemoryVariableStorage varStore; void Start() { lyreStringOne.SetActive(false); } void Update() { InMemoryVariableStorage = GetComponent<InMemoryVariableStorage>(); varStore.GetValue("$lyreOne").AsString; }
But I've been getting a couple of errors:
error CS0118: 'InMemoryVariableStorage' is a type but is used like a variable
error CS0201: Only assignment, call, increment, decrement, await, and new object expressions can be used as a statement
Also, I'm not sure how to go from there, if I can just write
if ($lyreOne == true) { lyreStringOne.SetActive(true); }
Sorry if formatting is weird, first time posting.