Syncing multiple instances of same MonoBehaviorPun class on the same game object
Options
I have an Ability script, and each unit game object has multiple Ability components attached to it. I want to sync them each separately with OnPhotonSerializeView. However, syncing doesn't work when you have multiple components of the same script on the same game object.
Is PUN planning to fix this limitation? It makes coding a lot more cumbersome. You have to use a separate script that has to coordinate syncing multiple components even though they all should have the same independent logic.
Is PUN planning to fix this limitation? It makes coding a lot more cumbersome. You have to use a separate script that has to coordinate syncing multiple components even though they all should have the same independent logic.
0
Comments
-
Any insight on this?0
-
What did you dried that you say, syncing doesnt work with OnPhotonSerializeView using mutliple components ?
And what is you setup ?
Is each ability using OnPhotonSerializeView ? or is there one point where all ability gettings syned with OnPhotonSerializeView ?0 -
The setup is:
One GameObject with a PhotonView
Two "Ability" components attached to that GameObject.
The Ability script has OnPhotonSerializeView which syncs the cooldown.
However, when you have multiple components with the same script on the same object, then the syncing doesn't work properly.0