Hi, I’ve been following the videos along quite well however I’ve got to the GetStateStory(); moment and it kicked back the following error
“Assets\AdventureGame.cs(17,36): error CS1955: Non-invocable member ‘State.GetStateStory’ cannot be used like a method.”
I’ve looked at line 17 in my AdventureGame script and I’m not sure what is going on. Any help would be appriciated!
Cheers
Matt
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
public class AdventureGame : MonoBehaviour
{
[SerializeField] Text textComponent;
[SerializeField] State startingState;
State state;
// Start is called before the first frame update
void Start()
{
state = startingState;
textComponent.text = state.GetStateStory();
}
// Update is called once per frame
void Update()
{
}
}
This is my State script
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
[CreateAssetMenu(menuName = "State")]
public class State : ScriptableObject
{
[TextArea(10,14)] [SerializeField] string storyText;
public string GetStateStory()
{
return storyText;
}
}