Instanciate doesn't set the position ?

MoDDIB
MoDDIB
Hello.

I'm using a PhotonView in Reliable Delta Compressed.
It sounds like when a new player comes and execute "OnPhotonInstantiate"
for existing players,
he doesn't have the position of these players.
This position is sent after with the call of "OnPhotonSerializeView".

Is it a normal behavior ?
It won't be really clean to set in "OnPhotonSerializeView" that the first call will set the position.

Thank you !

Comments

  • When we instantiate a game object, you pass in a position. This is what we use to initiate the GO.
    Anything sent via OnSerialize will be executed after the GO comes into existance and thus can't be used when it's created.
  • Sorry I forgot to say that I ve passed the position to the instanciate function !
  • The position you set in Instantiate should be used on the remote clients. If it isn't, we have to fix a bug.
    Of course, we buffer the original position only and can't update it with newer positions.
  • Tobias wrote:
    The position you set in Instantiate should be used on the remote clients. If it isn't, we have to fix a bug.
    Of course, we buffer the original position only and can't update it with newer positions.
    So it's not a bug : I got the original position and of course I wanted the most recent position :)

    It's not a major issue, I have a workaround for it, but I think photon users would prefer get the right position instead of the original one.

    btw thank you for your answer and your amazing service !
  • "thank you for your answer and your amazing service !"
    thanks :D

    Yes, the current position would be nice but my first impression is that the updates would be a lot of work and the server does not really understand and track objects and positions (not the unity ones, at least).
    A workaround could be to instantiate at some far-away position and only with first pos update, the object shows?
  • A workaround could be to instantiate at some far-away position and only with first pos update, the object shows?
    That's what I'm doing ;)

    But I think you agree it's not really convenient ;)
  • I do.
    But I also know the effort needed to change this server side ;)

    Joke aside: It would be nice, of course. But it's not a huge deal to do it this way and we save a lot of performance on the server doing this. In turn, this means you game can run more players for cheap :)