- Home /
How to destroy child object of other player with UNET?
Right now, I have a multiplayer game where the player fires projectiles at other players that have a certain amount of bubbles. Once a player has lost all of their bubbles, they lose.
The issue I had previously was that on one screen, a first player could shoot out a second player's bubbles, but not all of the bubbles on the second player's screen would be popped, so I am trying to sync it over the network somehow.
The issue I'm seeing is that NetworkServer.Destroy requires finding the GameObject you intend to destroy by its NetworkIdentity,, but only the root Player GameObject is allowed to have the NetworkIdentity component on it. What's the best way I can sync the destruction of a child object of a player?
Answer by tormentoarmagedoom · Sep 13, 2017 at 07:47 AM
Good day @Ggabe !
To Destroy a child GameObject called Child of another GameObject called Father you need to:
Destroy (Father.transform.Find("Child"));
Ask more questions if need using @tormentoarmagedoom !
If this helps, upvote ! Bye :D
Hi @tormentoarmagedoom , I know how to destroy a child of a GameObject, but in a networked, multiplayer game, destroying a child GameObject on one user's screen doesn't necessarily destroy it on the other user's screen. What I'm asking is how to sync them to show up on all other players' screens.
Your answer
Follow this Question
Related Questions
Unity networking tutorial? 6 Answers
Problems with Scene Change networking Unet 0 Answers
send data from client to local server 0 Answers
Not calling OnServerAddPlayer() when client connect 0 Answers
server connecting issue 1 Answer