Why i can use transform points in prefab?

When i attach any follow path script to prefab, i cannot assign object to use it like waypoint.

Script for example

var targetA : Transform;
var targetB : Transform;
var targetC : Transform;
 
private var currentTarget : Transform;
var proximity : float = 1.0;
 
var speed : float = 1.0;
 
//with function Start we set at start the current target
function Start ()
{
   currentTarget = targetA;
}
 
function Update ()
{
   var Distance : Vector3 = currentTarget.transform.position - transform.position;
 
   //if "player" is "1" unit far, change currentTarget to next one
   if(Distance.magnitude < proximity)
   {
      switch(currentTarget)
      {
         case targetA:
            currentTarget = targetB;
         break;
         case targetB:
            currentTarget = targetC;
         break;
         case targetC:
            currentTarget = targetA;
         break;
      }
   }
 
   transform.position = Vector3.Slerp(transform.position, currentTarget.transform.position, Time.deltaTime * speed);
   //make object look towards currentTarget
   transform.LookAt(currentTarget);
}

Why this happens?

I have done a simple 1st phase test on your script and it acts as expected. I can add a reference to the targets in the inspector for instantiated prefabs containing this script.

However, don’t forget, that you cannot populate a reference to an object in any one given scene to a prefab asset.

The prefab asset is the prefab that is in your assets folder and you can see it in the Project window.

A prefab “instance” is one of potentially many instances of your prefab asset that you have “instantiated” in any given scene.

The prefab asset can be instantiated or spawned/placed in any scene in your project, so having a reference to an instance of an object in any given scene would not make sense. If a prefab asset had reference to 3 transforms in Scene01 and it was instantiated/spawned/placed in Scene02, how would that instance of the prefab have any access to the referenced transform in Scene01, which is not loaded? It can’t. So the prefab asset cannot store a reference to an instance in a scene.

You must populate your scene instances in an instance of the prefab within the same scene.

If you are doing this at edit time, you can place the prefab into your scene and drag the reference into the slots in your scene.

If you are doing this at run time (say Instantiating this script after you hit play) you will need to write code that finds these transforms at runtime.