Last changes have broke my game

I was trying to do all stuff from the lecture and after the game stopped working. I tried to fix it, doing changes I see in the change log on the site directly in files, but it didn’t help. After I tried to export some stuff and import it to the new unity project, but it also does not work. Please answer me if you can help me or I need to all things from zero, without using the export-import thing. Thank you))

Maybe share your scripts here so that someone can help check for possible problems.

I jut finished this lecture and mine is working, maybe I can help if I see your script :slight_smile:

AdventureGame.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class AdventureGame : MonoBehaviour
{

[SerializeField] Text textComponent;
[SerializeField] State startingState;

int[] oddNumbers = { 1, 3, 5, 7, 9 };

State state;

// Start is called before the first frame update
void Start()
{
    state = startingState;
    textComponent.text = state.GetStateStory();
    Debug.Log(oddNumbers[3]);
}

}

State.cs

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

[CreateAssetMenu(menuName = “State”)]

public class State : ScriptableObject

{
[TextArea(14, 10)] [SerializeField] string storyText;

public string GetStateStory()
{

    return storyText;
}

}

I fixed it guys, thank you.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.

Privacy & Terms