I’m working on creating a
Usable items system. By
Usable I mean stuff that you use on triggers - (think Keys, Lighter, ManholeOpener, Crowbar, etc)
The approach I’m going for is - (which I think is the easiest) - is to have the
Usable item reference the triggers that it’s used on.
One note about
Usable items, is that one item could be used in many places (triggers)
So I thought I save my items as prefabs, and then travel between scenes to set the appropriate triggers for my item. (So, a
SkeletonKey could be used to open
But the problem is, prefabs can’t reference scene objects - they’ll just die and be null.
(A normal prefab won’t even allow you to assign scene objects - but with a custom editor, you could assign values - but they’ll just be nulls)
So… how can I create an asset, that would be able to reference gameObjects in separate scenes, and persisting those references?
If you think there’s a better approach to
Usable items, I’m all ears.
(Maybe create an asset of a
ScriptableObject, and then save all the usable data for all the items there? - something like a table of “item-triggers”)
Thanks for any suggestions.