Setting parent on spawned object Unet
So I spawn a weapon using NetworkServer.Spawn(myweapon) which works, but i want to set the parent of myweapon. So I set the parent before I spawn the weapon but it only gets set on the server because NetworkServer.Spawn(myweapon) is a command, and I can't pass gameobjects as parameters so I can't call a ClentRpc to set it on the other players. I need help how do I set the parent on all clients?
@IA$$anonymous$$BAT$$anonymous$$AN You should pass the NetworkIdentity of the parent to ClientRpc/Command and use the NetworkIdentity.gameObject to find the parent you want to set. So if the path to the parent is, let's say, "Arm/ForeArm/Hand/" then use NetworkIdentity.gameObject.transform.FindChild("Arm/ForeArm/Hand/")
.
Your answer
Follow this Question
Related Questions
Need help for Player Spawning and Player speed control slider!! 2 Answers
Failed to spawn server object, assetid=... 1 Answer
uNet Spawning Objects 0 Answers
Unity Photon Handle Match Data 0 Answers
Unet - spawning bullets, two issues 1 Answer