How could I sync an objects active or non active state?

Hey, I'm pretty new to photon and don't have too much knowledge with it, but I wondered if there was a way I could sync the active or non-active state similar to how the photon transform can sync Position, Rotation, and Scale. Any help is appreciated.

Best Answer

  • Tobias
    Tobias admin
    edited May 2022 Answer ✓

    Ah, that's what you plan to do.

    You don't sync that.

    The trigger to show the visuals is that there is a collision. This can be detected either locally (some clients may not detect it due to slight differences in the reproduction of remote objects) or you may sync the collision (as in: you send an RPC that signals someone was hit). Then show the visuals / effect and disable it after time X or when it's done or the collision ends or so.

    It's good practice to derive effects from some game state you already have.

    About synchronization and state.

Answers

  • You may have to use an object that is active to control another object's enabled state.

  • But the times that the other object would be set would only be when the player decides to collide with another part which enables an invisible cosmetic on their head that's always their but inactive. So how would I do?


    Thanks for the response btw 😃

  • Tobias
    Tobias admin
    edited May 2022 Answer ✓

    Ah, that's what you plan to do.

    You don't sync that.

    The trigger to show the visuals is that there is a collision. This can be detected either locally (some clients may not detect it due to slight differences in the reproduction of remote objects) or you may sync the collision (as in: you send an RPC that signals someone was hit). Then show the visuals / effect and disable it after time X or when it's done or the collision ends or so.

    It's good practice to derive effects from some game state you already have.

    About synchronization and state.