- Home /
Unable to drop GameObject in Inspector of other GameObject
Hi,
Thank you for coming by and reading this post!
I'm currently working on a project which involves a scene that does some drag and dropping, "focusing" mechanics as well as some file writing mechanisms. The way that one scene is organized is:
Drag And Drop Manager:
An empty game object which holds a script of class "DragDropRaycast", which is comprised in the nested namespace draganddrop.raycast (terribly original indeed) and which takes in an empty game object Camera Controller with an attached script of class FocusHandler as follows:
public FocusHandler focusHandler;
Fetching this class is done by dropping the Camera Controller Game Object in the inspector of the Drag & Drop game object.
Camera Controller:
This empty game object has two scripts attached to it: one that handles the double clicking on an object and another one which operates the rotating of that selected object. This last script has to take in the Drag And Drop Manager because it needs to access a run-time-evolving value that is returned by the "DragDropRaycast" associated class. So this scripts uses the namespace dragdrop.raycast (through the associated command "using dragdrop.raycast" at the very beginning of the code of course). Hence the rotation script has that one line:
public DragDropRaycast dragdropController;
Problem:
Now this is where the things go wrong. Although the same line and process is done successfully with the camera controller in the drag and drop manager inspector, the Drag And Drop Manager cannot be dragged in the inspector of the Camera Controller for some reason, although the inverse operation does work. In the inspector, when the little round adding button next to the slot for dragging the game object is clicked, no object is proposed.
Other objects and scripts need to access that Drag and Drop Manager associated class so this is a key problem that cannot be circum navigated. These objects are not referenced by the DragDropRaycast script, so the problem does not lie in a sort of "interpenetration" conflict.
Thank you very much for reading, and feel free to ask for any further information!
Your answer
![](https://koobas.hobune.stream/wayback/20220613055745im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Getting a Reference to a Prefab Dragged into Scene 1 Answer
Using interfaces as composeable plugins for a health system 1 Answer
Is there a quicker way to populate animated tiles? 0 Answers
Script forgets assigned Inspector variables 2 Answers
How to find in what Scripts or components an Object is connected 0 Answers