Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Question Health Bar is not updating among clients

Discussion in 'Scripting' started by billy2k1, Feb 24, 2022.

  1. billy2k1

    billy2k1

    Joined:
    Nov 11, 2021
    Posts:
    9
    So for some reason, whenever my player shoots and lands a hit, the damage is taken by the other client, and its health bar is updated. However, the shooter does not have an update of the damage on his screen.

    I can not wrap my head around as to why it doesn't update. Is it because I do not have a function updating the fill amount on the clients end?
     
    Last edited: Feb 24, 2022
  2. PraetorBlue

    PraetorBlue

    Joined:
    Dec 13, 2012
    Posts:
    7,735
    Well I mean there's this, clearly saying "don't do this if I don't own the character"
    Code (CSharp):
    1.         if (!view.IsMine)
    2.             return;
     
  3. billy2k1

    billy2k1

    Joined:
    Nov 11, 2021
    Posts:
    9
    :oops: The issue was laying right in front of my eyes.