I ran into what seems to be a restriction on how I can assign existing GameObjects to public script variables. I didn't see anything about it in the documentation, it should work, but, doesn't...
I have two Prefab asset/models, called pf-Box and pf-Tube. I drag pf-Box onto my Scene, so it's now instantiated at development time (is that the opposite of runtime?), as aBox.
pf-Tube will be instantiated at runtime, and I want it to have a reference to aBox, so I create a script, called s-Tube, with a public variable, tmpObject, and add the script as a Component to the Prefab pf-Tube.
Then, in the Inspector window, I select the triangle dropdown box for tmpObject, and try to assign aBox to it - but it won't assign.
Looking at the dropdown box, it separates objects into two categories, Assets and Scene. I can assign things in Assets to my script variable - but I can not assign objects already existing on the Scene to my variable.
Is that correct? Are there restrictions on what objects can be assigned to a (not-yet-existing) script variable? Or is there some deep, dark configuration option that I don't have set right to allow it? :)
Note - I know there are other ways to reference existing GameObjects. But using a public script variable is a lot simpler, and seems like it should work.
John C>
"For all your days, prepare, and meet them ever alike;
When you are the anvil, bear - when the hammer, strike."