Assign Interactables - clever ways?

Hey Everyone!

So we are developing a Game where we have “Interactable” Objects.

Our AI have a Daily Route, after reaching a certain Point, the AI stays there for a certain time, in that time the AI should consider interact with any Interactable i would like. (My System is much more than that but lets keep it simple for now).

Since my AI is getting Instantiated, i need to assign certain data to it which makes drag and drop from the inspector not work.

Are those ideas good? →
1.- Have a Global Interactable Manager having all Interactables Stored, on AI Instantiation, the AI will get the “wanted” Interactables assigned into their Daily Routine?

2.- The ScriptableObject way is a bit Time intensive and more management intensive.

  • Create InteractableSO with “Interactable” field.
  • On Game Start, assign the Interactable reference with the InteractableSO.

That way i have a reference in the InteractableSO with the Interactable in the Game.
It would cause me to create for each Interactable an SO and assign the reference on Start with the desired SO.

Would love to hear any thoughts on those 2 Options + if any other idea is crossing someones mind, would love to hear it.

(We are talking here about 1000 Interactables at least, which makes the ScriptableObject way a bit shaky).
We are using Dynamic Scene Loading cause we have a huge world, which means we have for each Scene a directory for the “GameLogic” part. so it might not get “too” messy but im worried about it anyways having so many of them overall, so maybe the Global Manager way is the more valid one? Or either are bad and there is a much better way to do it.

I’d probably go for the global manager out of those options.

I know many people on this forum will advocate for ScriptableObjects though given their robustness.

But honestly for simplicities sake, global manager sounds fine to me! Seek another solution if and only if it becomes a problem. Sounds like you were leaning that way anyway :wink:

1 Like

Much as I love scriptable objects, I wouldn’t use them here either.

A manager makes sense. All interactable objects could subscribe to a manager on Awake, and and AI entities can just pick and choose from among them in a fanciful decoupled manner.

1 Like

Thanks for your answers!

SOs are a great but in terms of 800 AI - 1400ish Interactables its way too much overhead i think.