string to transform ?

okay i am trying to send an RPC for an AI to change target variable, so it can follow the target. the problem RPC cant send transform variables so i need to change from string (i guess) to transform.

	void ChangeTarget(Transform TAR) {
		tar = TAR;
		if (Network.peerType != NetworkPeerType.Disconnected) {
			networkView.RPC("NetChangeTarget",RPCMode.All,TAR);
		}
	}
	
	//RPC
	[RPC]
	void NetChangeTarget(transform NTAR) {
		tar = NTAR;
	}

if you have a string like “12.34,12.34,12,34” take a look at String.Split() and Double.Parse()

I thought NetworkView dealt with transform updates?

mmm no, let me explain myself better i cannot use the networkView to watch the transform; instead i gotta use and RPC to change the variable and the mob will do his movement locally, a little weird i know but i think is the best way to make it. The multiplayer part of the forum is very dead lol. so just think i must change a transform variable but i can only use string or vector3 int float basic types. so i dont want to send a position update i want to send a change to the variable tar (witch is a transform).

sorry for the bad english :frowning: from puerto rico

You can send Vector3 and Quaternion values by RPC so you can use these to set the position and rotation of the transform. If you need the transform’s parent, probably the only way to go is to pass the GameObject’s name as a string.