Disable Syncing of photonView?

Options
Hey guys, I was curious, I have tried using MyPlayer.GetComponent().enabled = false;
But I don't think it's working, or how to tell if it even is, because in the editor I still see a red debug line going from the player to mine.

(I'm wanting to stop sending position,rotation info, because I have my players press e to enter a tank, etc. No reason to sync any of there stuff if you just plainly can't see them, if that makes sense?

Not sure if this is possible? I wouldn't see why not.
Just tried photonView.enabled = false; still don't work.

I do use PhotonServer, but using it inside Unity.
So would this be a server side thing I have to figure out some how?

Comments

  • N1warhead
    N1warhead ✭✭
    edited August 2015
    Options
    oops at the top I meant MyPlayer.GetComponent().enabled = false;


    IGNORE THIS MESSAGE, I realized it's the forum removing the < > symbols.
  • N1warhead
    Options
    (It won't let me edit the message above or delete it). But just letting everyone know I still need help with the original question.

    Sorry not trying to spam, just making sure the "IGNORE THIS MESSAGE" part wasn't to be understood as this entire question, just the post I made above this one that's all.
  • Tobias
    Options
    If you want to stop sending positions, just don't "write" any updates in OnPhotonSerializeView.
    Your script has to handle that. The PhotonView will observe scripts, even if they are not active in hierarchy.
  • N1warhead
    Options
    Hey Tobiass!
    (Not sure if your the same Tobiass) on the Unity forums, but I random just figured it out!

    I figured it out trying to do something else.

    But this is the code I used.

    photonView.synchronization = ViewSynchronization.Off;
    I mean I at least know it didn't update position info, not sure if it's stills ending out 10 msg/s when not doing anything.

    I have been wondering about that actually, when you have a photon view on something, and it's doing nothing but waiting for an Input to E.G. - Shoot the gun, is it still sending 10 msg/s when it's not observing anything but waiting for an input?

    That's the only way I know how to do it is to put a PhotonView on each object that does something.
    E.G. (1 for player movement tracking, 1 for shooting).