authoritive server assign smoothfollow target

Hi,

i'm trying to assign a camera to a player instantiated by the auth server. How can i refer to a specific player ? Where can i find more info on that ? Thanks.

You are looking for the NetworkView.Find() method. See http://unity3d.com/support/documentation/ScriptReference/NetworkView.Find.html for more info.

Basically, get the networkview ID from your RPC, then use Find(ID) to return the NetworkView of the object you're looking for. NetworkView has access to the standard gameObject, transform, etc. variables.

cam.transform.parent = networkView.Find(ID).transform;

this : cam.transform.parent works but it sets the the transform to the transform of my player object. Is there a way to assign that found ID to the script ? i tried :

var myNewTrans : Transform = Network.Instantiate(playerPrefab, transform.position, transform.rotation, playerNumber); var newObjectsNetworkview : NetworkView = myNewTrans.networkView; var newViewID = newObjectsNetworkview.viewID; var go : GameObject = GameObject.Find("Camera"); var sf : SmoothFollow = go.GetComponent(SmoothFollow); var newGO : GameObject = networkView.Find(newViewID).gameObject; sf.target = newGO.transform;

but i get a null reference now. NullReferenceException: Object reference not set to an instance of an object Any ideas ? Thanks :)