State option not showing up

I added the code as shown, but when I go back into Unity and right click, State isn’t an option.

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

[CreateAssetMenu(menuName = “State”)]
public class State : ScriptableObject
{
[SerializeField] string storyText;
}

Hi Brian,

Did you save your script properly? Have you tried to restart Unity? Your Console shows an error message. Fix it first. If the asset still does not appear in the menu, try [CreateAssetMenu(menuName = "State", order = 1)].


See also:

Thank you for getting back to me. I had a problem with another script that was open at the same time. I deleted it and things are smooth now. If it’s important I can add it again later

Thank you,
Brian

I’m glad that you fixed the issue. :slight_smile:

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

Privacy & Terms