- Home /
This question was
closed Oct 14, 2018 at 08:12 PM by
pts089 for the following reason:
Problem is not reproducible or outdated
[UNet] How to control spawned object on client side?
I want to spawn object:
void SomeClick(GameObject otherObj)
{
if (isServer)
{
GameObject obj = Instantiate(spawnPrefab);
NetworkServer.Spawn(obj);
otherObj.Func(obj);
}
}
How execute"otherObj.Func(obj);" on client side?
Comment
Answer by drv14 · Apr 27, 2018 at 12:56 AM
I think you are looking for RPC calls.
https://docs.unity3d.com/ScriptReference/Networking.ClientRpcAttribute.html
Orami explains it well here:
https://answers.unity.com/questions/1202649/rpc-client-and-server-playing.html