I’m gonna try and keep this simple, as my problem is happening quickly. maybe my mini stroke has something to do with it, but i seem to recall making this work before, though i can’t find that project.
public FakeSave fakeSave;
public GameObject shipPrefab;
Void Awake()
{
fakeSave = Resources.Load<FakeSave>("Assets/Resources/Data");
shipPrefab = fakeSave.saveShipPrefab;
}
assume everything is spelled correctly, there is a Resources folder in Assets, the name of the FakeSave SO is Data. also assume the fake save really is FakeSave : ScriptableObject.
my thought is that the SO isn’t a mono, so it can’t actually put itself into a reference.
second try was
public GameObject shipPrefab;
Void GetShipPrefab()
{
shipPrefab = Resources.Load<FakeSave>("Assets/Resources/Data").saveShipPrefab;
}
same as above, just assume everything is spelled correctly, Data exists where it should, there is a perfectly good prefab in the SO’s saveShipPrefab slot.
why does it always end up null with a Debug.Log(fakeSave) and debug.log(shipPrefab) throws an error (that part is obvious) in the first case, or Debug.Log(shipPrefab) in the second case?
which part of this am i not remembering or does not actually work?
note that yes, the code is longer, but i specifically ordered all of these for testing to be the very first things in the order of operations, with debugs, and they they fire in the order expected, so i did the short form in a new scene, and same issue.