Wiki

Case Status
Log In

Wiki

 
Home ยป Add-ons»Photon Networking»Photon DemoWorker Sample»Photon DemoWorker GameObject N…
Index
Navigation
Community Wiki

Photon DemoWorker GameObject Naming Fsm

Simply change the name of the gameObject to be easily found in the scene.

Network View OwnerShip Concept 

We are dealing with the player gameObject, which means it exists on all running instances that are in the same room. It is critical to understand the concept where the player gameObject instanciated on your computer or device is the "owner" of this network instance, and that all other applications running that should see your player, do not own this player, they are and should be slaved to what you are doing with your player.

For this, there is a very convenient action, "photon View Get is Mine", which lets you detect if this gameObject is yours ( as in, you are in control of it), or not ( meaning it is the player of another user that you see because in the same room as you).

Setting the GameObject Name for Clarity

So the first thing we are going to do, that is not critical from a playability point of view, but extremely helping when developing is to name the gameObject properly, based on whether this is your player or someone else's player.

For this, we query first: Is it mine? If yes, we add "me" to the gameObject current name, else we get the owner name, and add it to the current gameObject name. This way, when you look at the hierarchy browser of your scene, you will see which player is yours ( "me") and which are not ( appended with the username of the owner).

If you don't understand this concept, do not hesitate to contact us via the forum, we will gladly reword or point you to other resources, that will explain this concept in details. It is of course important that you read the Photon documentation first before diving into using it.

Tags:

Last modified on 5/15/2012 4:32 AM by User.

  • RSS Feed