“there is a registration step that
clients have to perform; they must
call ClientScene.RegisterPrefab to
tell the system about the asset that
the client object will be created
from”
Lets say I want to call NetworkServer.Spawn(prefabHere); on the server…
Is this the correct function to call?
Do I need to register the prefab?
If so do I use ClientScene.RegisterPrefab or another class/function?
Yes, it is, and as you wrote, you can call it only on the server side.
Only on the client-side as the documentation mentioned it.
That function is what you looking for.
If you don’t register the prefab on the client-side, it won’t be instantiated on the client.
And of course, your prefab has to have a NetworkIdentity component.
In this sample I added a projectile prefab to NetworkManager\SpawnInfo\RegisteredSpawnablePrefabs (which is quite inconvenient).
I changed parameters of gobjProjectile and I’m trying propagated this projectile to all clients on the arena.
So the question is: How can I pass parameters to gobj?
Because NetworkServer.Spawn() strips all modifications to the object, and all clients receive a zeroed copy.
And this robbery is contradicting to documentation http://docs.unity3d.com/Manual/UNetSpawning.html which specifies exactly the opposite: “When this code runs, the tree objects created on clients will have the correct value for numLeaves from the server.”