How do I get my local player's PhotonView?

The whole answer can be found below.

Please note: The Photon forum is closed permanently. After many dedicated years of service we have made the decision to retire our forum and switch to read-only: we've saved the best to last! And we offer you support through these channels:

Try Our
Documentation

Please check if you can find an answer in our extensive documentation on PUN.

Join Us
on Discord

Meet and talk to our staff and the entire Photon-Community via Discord.

Read More on
Stack Overflow

Find more information on Stack Overflow (for Circle members only).

Write Us
an E-Mail

Feel free to send your question directly to our developers.

How do I get my local player's PhotonView?

tatelax
2015-05-19 03:16:22

I'm trying to get either my local player's PhotonView, or the GameObject that my local player's PhotonView is attached to. I'm surprised I have not found anything online about this. The reason I ask this question is because I have certain UI buttons that exist before my player spawns. Those buttons change variables that are located on my local player.

Thanks,

  • Tate

Comments

tatelax
2015-05-25 21:25:29

Still looking for help on this topic. Maybe I have the wrong approach to this concept.

Tobias
2015-05-26 09:16:25

When you call PhotonNetwork.Instantiate(), it will return the GameObject you just created. This is "your GameObject". Or one of yours. You can keep a reference for this GO in your code, if you need to modify it.

Back to top