I’ve recently started playing around with Yarnspinner, but I need to be able to set variables from a C# script. My current attempt using the following code:
public class YarnVariableHolder : MonoBehaviour
{
public string PCName = "Alex";
public void Awake()
{
InMemoryVariableStorage.SetValue("PCName", PCName);
}
}
returns a “an object reference is required for the non-static field” error, and I am not sure how to fix it.
any help is greatly appreciated