- Home /
how i can apply changes objects on Network.Instantiate?
hi ,
i have this code for instantiate prefabe to others network
var PlayerP=Network.Instantiate(playerPrefab, transform.position, transform.rotation, 0);
the problem is , if i want to change something on player it will not applied. i mean if i want to deactive/active some objects on [PlayerP] it will work on my game only , not on network, how i can to apply all changes to other users on network. thank you all.
Answer by whydoidoit · May 21, 2012 at 08:53 AM
You need to send some RPC calls that do the "turning off". Those methods can be made to act on every object connected.
Write your turn off method and decorate it with an @RPC (unity script) [RPC] C# then call it using something like
networkView.RPC("NameOfTurnOffMethod", RPCMode.All);
Your answer
![](https://koobas.hobune.stream/wayback/20220613071623im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Network.Instantiate a Non-prefab 1 Answer
Network.instantiate only works for Server to client 0 Answers
Network rigidbody synchronize 0 Answers
SpawnWithCLientAuthority Issues... 0 Answers
RPCs and instantiations being dropped/appearing out of order 1 Answer