UNET Health help
So I'm making a 2D casual pvp game to play with my friends, and while i have most of the networking stuff down, I'm having some trouble with my health setup.
As (badly) portrayed in the picture, I want the health text on the banners to match the health value of its corresponding turtle.
The banner and turtle are two separate objects, so I made a GameObject variable called "Player" in the the banner script to set the health text to the corresponding turtle's health. Currently, when a turtle is created, the turtle's script checks if it is the localplayer on the network, and if it is, it spawns a banner in the correct location and then sets the Player variable in the banner's script to the turtle. However, this will only set your turtle's health text, and not the other ones.
I thought about making the banner a child of the turtle so that I could just set the health text to the parent's health, but then the banner would move with the player.
Any suggestions?
Sorry for the bad explanation btw :^)
tl;dr how would I get a player to spawn a health banner and set the text on the banner to the player's health on all clients?
Answer by Guhanesh · Feb 04, 2016 at 07:51 AM
You can spawn as banner child of player then you can unparent the banner on Start().
Your answer
Follow this Question
Related Questions
Help with multiplayer melee 0 Answers
How do I get health of another networked player? 0 Answers
Unity Multiplayer: when i hit another player all players health bars go down 0 Answers
RPC sending Failed 0 Answers