16
TNet 3 Support / Re: Create localPlayerPrefab and remotePlayerPrefab
« on: October 10, 2017, 12:07:58 PM »
by this code my player from Editor don't synchronizing with othe player from build PC, but between PC builds all work is fine. it is possible to fix this? - my client from Editor can't send RFC to player(on PC build)
- IEnumerator CreationPlayer()
- {
- while (TNManager.isJoiningChannel) yield return null;
- if (channelID < 1) channelID = TNManager.lastChannelID;
- Transform pos = GetStartPosition();
- TNManager.Instantiate(channelID, "CreateAtPosition", "", false, pos.position + (Random.insideUnitSphere * 2), pos.rotation, TNManager.playerID);
- }
- [RCC]
- static GameObject CreateAtPosition(GameObject o, Vector3 pos, Quaternion rot, int id)
- {
- if (id == TNManager.playerID)
- {
- //Debug.Log("Local");
- GameObject go = Instantiate(Resources.Load("Player3")) as GameObject;
- Transform t = go.transform;
- t.position = pos;
- t.rotation = rot;
- return go;
- }
- else
- {
- //Debug.Log("Remote");
- GameObject go = Instantiate(Resources.Load("Player3(Remote)")) as GameObject;
- Transform t = go.transform;
- t.position = pos;
- t.rotation = rot;
- return go;
- }
- }