Slider/Health Bar with Photon

Options
Hello everybody ! (sorry for my bad english i'm french ^^)

I use for my 2d Game a slider to make a Healthbar to my player, It's work fine in solo, but when i connect 2 player , if one get hurt, it's the slider of the second player who is changed (not the health)

The slider is attach to a canvas, and this canvas is attach to the player( to be instanciate with the player, even the slider don't care about the health value)

Thx if someone can help me ! Bye!

Comments

  • Hi @redskry,

    as far as I understand the player is already instantiated and has a reference to the health bar, am I right? In this case you can use for example the Update() function to regularly update the health bar with the health value from your character.

    If you have problems synchronizing the health value of the characters, you may want to take a look at the Basics Tutorial. It provides a section about synchronizing a health value across the network.
  • redskry
    Options
    Thx ! i solved my problem , the Health bar worked perfectly but they was superposed with all bar , so i solved it with IsMine, and destroy if it's not mine ^^