Skip to content

Commit

Permalink
quick edits
Browse files Browse the repository at this point in the history
  • Loading branch information
default user name committed Oct 11, 2022
1 parent 12e4ce9 commit 7781486
Showing 1 changed file with 31 additions and 33 deletions.
64 changes: 31 additions & 33 deletions Documentation/3.5_Multiplayer_Objects_Overview_and_Tutorial.md
Original file line number Diff line number Diff line change
@@ -1,33 +1,31 @@
# 3.5. Multiplayer Objects Overview and Tutorial

This documentation accompanies the [Multiplayer Simple Scene](./2.1_Sample_Scenes.md), and describes the types of objects that can occur in a multiplayer project:

* There are 3 types of objects that can be shared in a multiplayer setup; choose the one that your users need.



| | What can multiple users do with it? | What components does it need? |
| ----------------------------- | ----------------------------------------- | ----------------------------------------------------------------------------------- |
| Object through creation menus | Look, Move, Modify, Spawn multiple copies | Renderer
<br/>Collider
<br/>PhotonView (ownership: Takeover) |
| Static scene object | Just Look at them | None<br/>[If you want basic networking, you can attach PhotonView and script RPCs] |
| Synchronized scene object | Look, Move, Modify | |

* **Static scene objects:** These are built with the scene and are not modifiable by users. Use this if you want all users to just look at the same objects. They are visible to all users, but cannot be moved/modified; and if a user does move them (ex: while running in the Unity editor) the object’s properties are not synchronized between users. The ManualCube_Static is an example of such an object.
* **How to create it before running:** It was created by right-clicking on the scene and creating a 3D Cube object.
</br></br>
* **Synchronized scene objects**: These objects are built with the scene, and are modifiable by users. Use this if you want all users to look and manipulate objects. They are visible to all users and, when modified, their properties are synchronized between all users. The ManualCube_PlayerMoveable is such an example (*if you cannot find it in the scene while Unity is running, search for it by name because it will have been moved under the networked objects root).
* **How to create it before running:** It was created by making a simple 3D Cube, then adding to it the following scripts:
* _PhotonView_: used by Photon to synchronize the object across users; note that ownership must be of type Takeover.
* _PhotonTransformView_: used by Photon to send/receive the object’s transform; note that all the object properties are synchronized.
* _PlayerCreatedObject_: used by our system to let users move/edit the object. This script also creates a bunch of other scripts on the object to make it respond nicely through MRTK interactions.
</br></br>
* **Objects created through creation menus:** These objects are created at runtime through the object creation menus. Use this if you need users to spawn multiple objects and modify/move them around. They are just like synchronized scene objects but they are created through the menus.
* **How to spawn one while running:** To create one, run the project and select a Cube from the in-world creation menu; it will be spawned for all users, and located under the networked objects root object.
* <picture><img src="./Images/object_menuu.png" width= "400" height="240"></picture>
* **How to add a custom object into the menu before building the scene:**
* Create a custom prefab for your object
* Make sure it has a Collider (that’s how users will grab it) and also a PhotonView (that’s how Photon will spawn it; and set its ownership to type Takeover). No other scripts are needed, the system will add other scripts when the object gets spawned.
* Put the prefab inside the Resources/CreationPrefabs folder. (This folder will be scanned when users see the menu).
* * Note, whenever you add a new object, you’ll need to rebuild the project for all users, otherwise the users will not have the object.
# 3.5. Multiplayer Objects Overview and Tutorial

This documentation accompanies the [Multiplayer Simple Scene](./2.1_Sample_Scenes.md), and describes the types of objects that can occur in a multiplayer project:

* There are 3 types of objects that can be shared in a multiplayer setup; choose the one that your users need.



| | What can multiple users do with it? | What components does it need? |
| ----------------------------- | ----------------------------------------- | ----------------------------------------------------------------------------------- |
| Object through creation menus | Look, Move, Modify, Spawn multiple copies | Renderer, Collider, PhotonView (ownership: Takeover) |
| Static scene object | Just Look at them | None, (If you want basic networking, you can attach PhotonView and script RPCs) |
| Synchronized scene object | Look, Move, Modify | |

* **Static scene objects:** These are built with the scene and are not modifiable by users. Use this if you want all users to just look at the same objects. They are visible to all users, but cannot be moved/modified; and if a user does move them (ex: while running in the Unity editor) the object’s properties are not synchronized between users. The ManualCube_Static is an example of such an object.
* **How to create it before running:** It was created by right-clicking on the scene and creating a 3D Cube object.
</br></br>
* **Synchronized scene objects**: These objects are built with the scene, and are modifiable by users. Use this if you want all users to look and manipulate objects. They are visible to all users and, when modified, their properties are synchronized between all users. The ManualCube_PlayerMoveable is such an example (*if you cannot find it in the scene while Unity is running, search for it by name because it will have been moved under the networked objects root).
* **How to create it before running:** It was created by making a simple 3D Cube, then adding to it the following scripts:
* _PhotonView_: used by Photon to synchronize the object across users; note that ownership must be of type Takeover.
* _PhotonTransformView_: used by Photon to send/receive the object’s transform; note that all the object properties are synchronized.
* _PlayerCreatedObject_: used by our system to let users move/edit the object. This script also creates a bunch of other scripts on the object to make it respond nicely through MRTK interactions.
</br></br>
* **Objects created through creation menus:** These objects are created at runtime through the object creation menus. Use this if you need users to spawn multiple objects and modify/move them around. They are just like synchronized scene objects but they are created through the menus.
* **How to spawn one while running:** To create one, run the project and select a Cube from the in-world creation menu; it will be spawned for all users, and located under the networked objects root object.
* <picture><img src="./Images/object_menuu.png" width= "400" height="240"></picture>
* **How to add a custom object into the menu before building the scene:**
* Create a custom prefab for your object
* Make sure it has a Collider (that’s how users will grab it) and also a PhotonView (that’s how Photon will spawn it; and set its ownership to type Takeover). No other scripts are needed, the system will add other scripts when the object gets spawned.
* Put the prefab inside the Resources/CreationPrefabs folder. (This folder will be scanned when users see the menu).
* * Note, whenever you add a new object, you’ll need to rebuild the project for all users, otherwise the users will not have the object.

0 comments on commit 7781486

Please sign in to comment.