Playmaker Forum

PlayMaker Help & Tips => PlayMaker Help => Topic started by: Bipolar on February 23, 2020, 09:58:59 AM

Title: [PUN 2] Sync the health info on joined
Post by: Bipolar on February 23, 2020, 09:58:59 AM
Hi.

I'm using PUN 2 recently.

I've made a health system. The problem is when another player joins the room after somebody inflicted/received damage: for the latest player joined, the other players' health will result as 0.

I need then to "download" an set the health info from the new player's point of view.

But perhaps... I'm on the wrong road because I'm not using RPC events to set health, but 'IsMine' check.

The fact is I tried to set health with RPCs but in the case of mine the changes are global: if I shoot the opponent, also the sender's life will be modified.

I tried with Other Buffered but It doesn't work anyway.

Here the screen of players' health modifiers.
I presume here misses something or it is not the best method...

Any idea?




Title: Re: [PUN 2] Sync the health info on joined
Post by: jeanfabre on February 24, 2020, 03:24:39 AM
Hi,

 where do you set the health value for it to be synched over the network? you should have a variable set to network sync and then set that variable if "isMine" is true or get that variable if "isMine" is false

Bye,

 Jean
Title: Re: [PUN 2] Sync the health info on joined (SOLVED)
Post by: Bipolar on February 24, 2020, 11:35:01 AM
Hi,

 where do you set the health value for it to be synched over the network? you should have a variable set to network sync and then set that variable if "isMine" is true or get that variable if "isMine" is false

Bye,

 Jean

Hi.
The problem was solved just yesterday after 3 days of trial-and-errors.
I posted here on the forum because after 3 days I was giving up, but now everything was solved and I learned how to do it. Thank you. :)
Title: Re: [PUN 2] Sync the health info on joined
Post by: jeanfabre on February 24, 2020, 12:10:04 PM
Hi,

 what was it then?

Never give up :) there is always a solution!

Bye,

 Jean