send string one time ?

Options
hello

I need to know how to send string var at bagging of join a room

when the player join the room I calculate something about local player, then I need to send it to others one time.

because OnPhotonSerializeView() function keep sending it, and I don't need that

thanks

Comments

  • dontonka
    Options
    Hello,

    For that you need to use an RPC call and you're done. Check in the PUN demos if you don't know what I'm referring too. That is the main purpose of RPC calls, to notify other players when an event happens, usually not all the time, like firing a bullet, opening a door, etc and NOT like player position, rotation etc. You could still call an RPC really frequently, but in that case it is probably better to use OnPhotonSerializeView if you can.

    I do similar stuff in my game. The other way around could be to put this information as custom properties in the room, that could work too, but I think the preferred way would be using an RPC.

    Cheers,
    Don T.