Property Changes Solutions

The whole answer can be found below.

Please note: The Photon forum is closed permanently. After many dedicated years of service we have made the decision to retire our forum and switch to read-only: we've saved the best to last! And we offer you support through these channels:

Try Our
Documentation

Please check if you can find an answer in our extensive documentation on Fusion.

Join Us
on Discord

Meet and talk to our staff and the entire Photon-Community via Discord.

Read More on
Stack Overflow

Find more information on Stack Overflow (for Circle members only).

Write Us
an E-Mail

Feel free to send your question directly to our developers.

Property Changes Solutions

Yosan
2022-04-01 11:13:38

I Work on Properties like this Example

[Networked(OnChanged = nameof(OnHpChanged))] public float currentHp { get; set; }

public static void OnHealthChanged(Changed changed)

{

changed.Behaviour.OnHealthChanged();

}

private void OnHealthChanged()

{

healthBar.UpdateUiBar(currentHpPoint / maxHpPoint);

}

I Found if values have changed to 0 it will not trigger

OnChanged Function how can I solve this.

Comments

Isaac_Augusto
2022-04-01 14:51:06

Hi,

Could you explain better what you're facing?

If a Networked property changed from, i.e : 1 to 0, on the next update the PropertyChange of that property will be triggered. But keep in mind that if it "changes" to the same value as before, it will not be called...

The property can also change more than one time before the next update, and if the final value is the same as the inicial, the change will be missed.

If you haven't yet gone through Fusion 100 series, take a look at: https://doc.photonengine.com/en-us/fusion/current/fusion-100/fusion-105

--

Isaac Augusto

Photon Fusion Team

Yosan
2022-04-02 04:12:24

Thank you Solved . I found if I use the next update the PropertyChange of that property will be triggered

Back to top