Property Changes Solutions
The whole answer can be found below.
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).
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.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
Thank you Solved . I found if I use the next update the PropertyChange of that property will be triggered
Back to top