Easy question for PhotonView and Observed Components
Options
I've been looking for a simple explanation for some of the fundamentals for photon but haven't been able to find much. I followed the Marco Polo tutorial and even got PUN working in my own game but I'm unclear on proper usage of PhotonView and Observed Components.
For PhotonView do you just need one per scene (the tutorial isn't clear on that) or are there instances when more than one is appropriate?
Also for the observed components portion of PhotonView, am I supposed to populate that with every possible gameobject that needs to be communicated across the network (e.g. Players, Enemies, Items for pick up, breakable objects, etc)? If so are people doing this via script since that could become quite arduous after a while?
For PhotonView do you just need one per scene (the tutorial isn't clear on that) or are there instances when more than one is appropriate?
Also for the observed components portion of PhotonView, am I supposed to populate that with every possible gameobject that needs to be communicated across the network (e.g. Players, Enemies, Items for pick up, breakable objects, etc)? If so are people doing this via script since that could become quite arduous after a while?
0
Best Answers
-
hmmm Objects already created int he scene do not need a photon view as they will be loaded by everyone anyway. But if you wanted them to move you would need a photon view.
say if it was a player hitting a box or something, you could send an RPC to say this box was just hit, tell everyone that it was.
hope this helps or maybe i misunderstood your question5 -
As I understand it (could be wrong!) PhotonView at it's most basic level, allows you to send RPC calls for a given object, and gives you a network Id you can use to talk about that object.
A PhotonView Observer component, can be used anytime you need to serialize some state of the object, each frame. This can be for movement, player inputs, health etc. By default it will update every 100ms, but you can increase/decrease that if you need.5
Answers
-
hmmm Objects already created int he scene do not need a photon view as they will be loaded by everyone anyway. But if you wanted them to move you would need a photon view.
say if it was a player hitting a box or something, you could send an RPC to say this box was just hit, tell everyone that it was.
hope this helps or maybe i misunderstood your question5 -
As I understand it (could be wrong!) PhotonView at it's most basic level, allows you to send RPC calls for a given object, and gives you a network Id you can use to talk about that object.
A PhotonView Observer component, can be used anytime you need to serialize some state of the object, each frame. This can be for movement, player inputs, health etc. By default it will update every 100ms, but you can increase/decrease that if you need.5 -
Thanks for the responses, that helps.0