Multiplayer doesn't work and Prefab(clone) never showing in play mode and hierarchy

Options
Hello
I'm start working in my first multiplayer project, so i try to learning first because i'm new in networking.
I watch this tutorial in youtube ""https://www.youtube.com/watch?v=v9m48nhfgvI&t=5s""
When i attach the Photon View script in my prefab and attach the tranform of the same prefab
in the Photon View and after delete the prefab and i try to build it and play it with play mode,
i don't get the prefab(clone) i try again and in this time i don't delete the prefab from
the hierarchy but i don't get the multiplayer game, i get the same "Car" (the prefab)
in the play mode and in the building project
I don't get any errors in the project just this warning when i attach the transform Prefab in the
Photon View and click ""apply"" for save Prefab change ==> ""PhotonView on persistent object being fixed (id and prefix must be 0).
Was: View (0)1 on Car (scene)
UnityEngine.Debug:LogWarning(Object)
PhotonViewHandler:
HierarchyChange() (at Assets/Photon Unity Networking/Editor/PhotonNetwork/PhotonViewHandler.cs:73)
UnityEditor.EditorApplication:
Internal_CallHierarchyWindowHasChanged()
""
But i don't understand it and i search in net but i don't get result
My prefab is name ""Car"" and it's an empty game object, inside it i have the main camera
and a cube
Im using Unity 5.6.4p2 with the free Photon network and i choose Photon cloud
this is some line of my code:

void Start () {
PhotonNetwork.ConnectUsingSettings(VERSION);
}

void OnJoinedLobby ()
{
RoomOptions roomOptions = new RoomOptions(){IsVisible = false, MaxPlayers = 4};
PhotonNetwork.JoinOrCreateRoom(roomNames, roomOptions, TypedLobby.Default);
}

void OnJoinedRoom ()
{
PhotonNetwork.Instantiate(PrefabNames, Spawn.position, Spawn.rotation, 0);
}
Thanks;

Answers

  • Sekmani52
    Options
    No one have an answer :neutral:
  • Hi @Sekmani52,

    I don't know this tutorial, so I can't help you directly with it. Since I assume that it is working, I would ask you work through it again and see, if you have done any mistakes.

    As a general information: Instantiating Prefabs by using PhotonNetwork.Instantiate, this Prefab has to be inside a Resources folder and needs to have a PhotonView component. If you want to synchronize the movement of this object, this PhotonView needs to observe an also attached PhotonTransformView component.