Why cannot I drag and drop a gameObject from Hierarchy to a prefab's slot in the Inspector?

I have a game object prefab, say myPrefab.

On myPrefab, I have a script attached, which contains this line (I want myPrefab to follow ObjectToFollow, but that is irrelevant):

var ObjectToFollow: GameObject;

So now in the inspector, when I have myPrefab selected, under the aforementioned script theres: Object To Follow ___________None (Game Object)

In the None (Game Object) field, I can drag and drop any other prefab.

I cannot however, drag and drop any game object from the Hierarchy into the None (Game Object) field. What should I do to put my gameObject to the Object To Follow slot in the Inspector?

The problem is that the ObjectToFollow is the main object of the game and it is already in the Hierarchy when the level begins.

I suppose theres something really basic that Im missing here.

Well, a prefab is a standard representation of a game object. If you dragged an object in from the scene, then it wouldn't be standard if you changed to a new scene.

Running a bit late with the answer, but, from what I gather you are trying to drag an object from the scene to myPrefab which is selected in the project view. This cannot be done. What you can do is make a prefab of the object that’s in the scene and then drag that prefab to a myPrefab (now you can drag from project view to project view).

Hope this makes sense.

Can't you change

var ObjectToFollow: GameObject;

to

var ObjectToFollow:Transform;