set the cloned prefab as target ????????

well,
in the hierarchy i have a camera with smoothFollowTarget.js ,
in my project i have a Cube-Prefab which cloned during the game …
is there any way to assign the Cube-Prefab as camera target when it is cloned during the game ???

when you create the clone, you can store a reference to it in a variable:

instead of-

 Instantiate(myCube,whatever.position,whatever.rotation);

use-

 var newCube = Instantiate(myCube,whatever.position,whatever.rotation);

then you can use this reference to set the target:

 var cameraScript = GetComponent(smoothFollowTarget);
 cameraScript.target = newCube;

EDIT: you shouldn’t mix c# and javascript in the same project, but if you must, keep in mind that the communication can only go ONE WAY, so the js can see the cs, but then the cs CANNOT see any js scripts… or vice versa… just pick one and convert the rest to that… BUT, based on your current info so far, you don’t need anything to SEE the camera script, so as of now here’s how to do it:

the cs script you provided:

void OnConnectedToServer(){
SpawnPlayer();
}
 
private void SpawnPlayer(){    
//change this line.. we declare a GameObject variable to store the new object reference
GameObject newObject = Network.Instantiate(playerPrefab, new Vector3(0f, 5f, 0f), Quaternion.identity, 0);

//find the camera, store a reference to the script
smoothFollowTarget theCamera = GameObject.Find("Name of camera object").GetComponent<smoothFollowTarget>();

//set the variable
theCamera.target1 = newObject.transform;
}

the js script you provided: (no change)

public var target1 : Transform;
      
function Start () {

transform.position.y = -647.2977;
transform.Rotate(270 ,0 ,0 );
 
}
 
function Update () {
 
var x = target1.position.x;
var z = target1.position.z;
 
transform.position.x = x;
transform.position.z = z;    
}

for this to work with both cs and js though, you would need to put the js script into a special folder that will compile earlier…

http://wiki.unity3d.com/index.php/Special_Folder_Names_in_your_Assets_Folder

just create a folder in your base Assets folder called “Plugins” and put the js script in there