How to connect a script to another script if neither are in game until spawned?

is there anyway of connecting scripts when they arent in game to start with?

Couple of methods, depending on your approach

  • Use static members, statics can always be accessed and never go out of scope
  • Set up the link in Awake. It will be available as soon as the GameObject is instntiated
  • Don’t inherit from MonoBehaviour and instead create your class with new. That can be done as far in advance of GameObject creation as you like.