SO and Resources.Load

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.

This is probably a two-headed problem. First, with using Resources.Load, the Asset directory and Resources directory are both implied. Using Resources.Load will point to Assets/Resources/ already. Second, I believe you’ll want to try and load Data.asset instead of just Data if it’s a ScriptableObject. I might be wrong on that part, however. This means one of the following should work:

If I’m right about it being a .asset file:

fakeSave = Resources.Load<FakeSave>("Data.asset");

And if I’m not:

fakeSave = Resources.Load<FakeSave>("Data");

yep, absolutely misread the docs, thought it wanted the whole path. thank you very much.