Marco Polo Tutorial Question
Options
Hi. In the Marco Polo Tutorial (http://doc.exitgames.com/photon-cloud/Marco_Polo_Tutorial/#cat-PUN%20Tutorials)
Under the "Fight for Control" section there is this code:
ive tryed defining it as a gameobject but that gives me an error, and
if i leave it as it is in the code above it gives me an error that "myMonsterPv" is not defined?.
Under the "Fight for Control" section there is this code:
void OnJoinedRoom() { GameObject monster = PhotonNetwork.Instantiate("monsterprefab", Vector3.zero, Quaternion.identity, 0); myThirdPersonController controller = monster.GetCompoment<myThirdPersonController>(); controller.enabled = true; myMonsterPv = monster.GetComponent<PhotonView>(); // <<< This line }What is "myMonsterPv's" defined as?,
ive tryed defining it as a gameobject but that gives me an error, and
if i leave it as it is in the code above it gives me an error that "myMonsterPv" is not defined?.
0
Comments
-
It must be a PhotonView.
The code tells you. Have a look:
...GetComponent<PhotonView>()...
In worst case, the PUN package has the completed Marco Polo Tutorial as source in some folder. Maybe it's a bit different from the tutorial's text here and there but close enough.0 -
Thank you Tobias !0