Activate and deactivate gameobjects over network

Options
hey all, i'm having problem activating and deactivating components across network. whenever i launch a rocket rocket deactivate from my side but i didn't deactivate on the other side over network..
i'm using simple code for deactivating component that is below.
rocket.SetActivate(false);
so is there anybody who can tell me how to write activating or deactivating code in Photon??

Comments

  • JohnTube
    JohnTube ✭✭✭✭✭
    edited September 2019
    Options
    Hi @hasnainn,

    Thank you for choosing Photon!

    Enabling or disabling components and activating or deactivating GameObjects is not automatically synchronized out-of-the-box using PUN.
    You need to do this manually using RPC or RaiseEvent or something else.

    But why do you need this?
    Maybe you can just destroy the GameObject using PhotonNetwork.Destroy and this way it will be synchronized on all clients?

    BTW: I moved this discussion to the PUN category.
  • hasnainn
    Options
    @JohnTube yeah that's true i can destroy that but the problem is that i will activate that rocket again when i'll purchase them so that's why i'm doing this.

    BTW is that possible activating and deactivating in Photon???
  • JohnTube
    JohnTube ✭✭✭✭✭
    Options
    BTW is that possible activating and deactivating in Photon???
    As I explained in the previous message, you need to implement this yourself.
    Note: I'm not sure if rockets should be network instantiated. Maybe you just need to send an RPC or a RaiseEvent to tell that a rocket is launched and its trajectory?