photonView.IsMine - Why doesn't it update for only me?
Options
I had a friend help me with a shield script which works wonderfully...but the main problem is that when I try to use it...it still shows up on ALL the other players as well at the same time even though I'm trying to use the photonView.IsMine function. Can anyone help me with this?
0
Answers
-
You re-defined photonView and probably set it to one PhotonView for all the characters.0
-
You re-defined photonView and probably set it to one PhotonView for all the characters.
I'm still fairly new to this, so I'm not sure what you mean by re-defined photonView?
I was trying to add in the Photon View component to distinguish from the others. So even if I removed these:private PhotonView photonView; photonView = GetComponent<PhotonView>(); if (photonView.IsMine) {}
Then it still does the exact same thing.
I'm just not sure as to how to use the PhotonView.IsMine function that would allow it to go for just a single character.
0 -
Only remove the photonView definition and assignment.
If one client instantiated each of the characters, then IsMine will be true on each. If you started multiple clients and each created one character, then IsMine will only be true on one character...
I would recommend to read and code-along the PUN Basics Tutorial. This should help you get the theory.0