Discrepancies/inconsistencies in PUN2 tutorial Section 5

Options
Hi y'all,

For the developers, I want to flag for you a couple issues with the PUN2 tutorial, section 5:

- Late in the tutorial you start referencing a field called
photonView
(lower-case *p*), for instance when checking
if (!photonView.IsMine)
but we never created that field nor point it to the correct PhotonView component. I believe your intention was to have a private field called photonView and to populate it at Start using
photonView = GetComponent<PhotonView>();
- Under "Health Checking for Game Over" you reference a block in the Update() callback that we have not previously added... you say there should already be a check for
if (photonView.IsMine)
in update, and that that's also where "ProcessInputs()" should be called, but this is a large discrepancy with how you demonstrate it earlier in the tutorial. Earlier you don't include the reference to the
this
pointer either.

Also, not sure if this is common or not, but my Kyle robot animation stops halfway through jumping and returns to standing.

This is a really great tutorial, so I hope this helps make it even better!

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    Hi @tetripod,

    Thank you for choosing Photon and for your feedback!

    PlayerManager extends MonoBehaviourPunCallbacks.
    MonoBehaviourPunCallbacks extends MonoBehaviourPun.
    MonoBehaviourPun has a photonView property with lazy initialization.
    That's how photonView ends up in PlayerManager.
    Maybe we should mention that.

    We will removed the "this." in "this.ProcessInputs()".
  • tetripod
    Options
    Thanks for the feedback, @JohnTube . When manually copying over the code I had missed that PlayerManager is supposed to derive from MonoBehaviourPunCallbacks, but even if I had I still would have been confused by the reference to photonView, since conventionally I would assume it was meant to reference a field or property I would have created manually!

    Also FYI, in part 7 you mention that "ProcessInputs()" should be moved into a block that checks for whether the photonView is Mine, but we already did that in section 5!
  • tetripod
    Options
    Sorry, the above comment should be more explicit: Yes, I think it's a great idea for you to mention the photonView property in the tutorial :)