Attach a GameObject to an instantiated GameObject at runtime
So I asked a question before that was perhaps a little vague, and after trying and failing for days I've come back with something more specific. I'm currently creating a logic gate game where when you play it at the bottom left of the screen are 3 buttons to create a game object that spawns where ever you click on the screen. What I need and can't seem to find is; how do I link two GameObjects that I've instantiated while the game is running? I can't access the tags as you could have more than one of that prefab making it select all of them, I can't access item name as all clones of the prefab have the same name, and I can't just drag and drop the GameObject into the other one as the games running. So how do I make a relationship between two objects, wire two objects together such that they share some sort of connection. Whether that connection be another instantiated GameObject or whatever else, I just need to get that connection. I'm honestly surprised I'm not able to find this, I would think this would be a common question but for whatever reason after 2 weeks of daily googling I still can't find anything helpful.
Your answer
Follow this Question
Related Questions
Link spawned objects together 1 Answer
Application.url dont work 1 Answer
(C#/OOP) Accessing one public function belonging to multiple gameObjects? 2 Answers
Calling function every x seconds but objects disappearing instantly 1 Answer
c# Getting Transforms from array made from FindGameObjectsWithTag 1 Answer