Photon Fusion Client Can't Spawn Network Object

Please help me solve the problem.

When the client joins the game and spawns network objects, the game can't work correctly and pops the exception like the picture following.9588778--1358398--ErrorPNG.png

The client game view is wrong but the Host game view is correct.

You may have to disable the "Collapse" option of the console to get a better idea of what happens first (and then causes all kinds of follow up exceptions).
Also: Take a step back. Create a simple object and make it networked to spawn that instead. In networked games it is often better to have a working state and then go step by step add things. Make each step work before adding complexity and you only have to solve relatively small problems instead of one huge pile of related errors.

If you let us know the initial errors (not collapsed), maybe a colleague of mine can chime in and help with some specific feedback.

I'm a beginner with fusion and i would appreciate some help if you could guide me how to use Runner.Spawn but for a client, to allow a client to spawn not the host only.

When spawning, you can typically only spawn on the Host if it is not in shared mode. You can check this by checking whether the runner is a client (NetoworkRunner.IsClient). This should mirror whether they have state authority assuming a host/client model. You can get more accurate by checking the documentation on state authority.

When a NetworkObject is spawned on the Host, it is spawned on all clients shortly after. This includes if the client joins late. As such, the client doesn't need to spawn any NetworkObjects directly. You can read more about this in the documentation as well.

1 Like