I was following a tutorial for creating ScriptableObjects that wasn’t very clear and for some reason I can’t get this ScriptableObject to be referenced in other scripts.
Soundpack.cs script:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Soundpack : ScriptableObject
{
public AudioClip[] SoundpackItems;
}
In other scripts if I for example type this:
public Soundpack mySoundPack;
It doesn’t recognize “Soundpack”. Is there a step I’m missing somewhere?
I have a script for creating the asset and it works even though it also does not recognize “Soundpack”. Here’s that script (note: it uses a custom function to handle the actual creation and saving stuff):
using UnityEngine;
using UnityEditor;
using System;
public class SoundpackAsset
{
[MenuItem("Assets/Create/Soundpack")]
public static void CreateAsset()
{
CustomAssetUtility.CreateAsset<Soundpack>();
}
}
EDIT:
Everything works as intended but Visual Studio just isn’t recognizing it and I’m not getting any errors in Unity…