Instanciate doesn't set the position ?
Options
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 !
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 !
0
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.0 -
Sorry I forgot to say that I ve passed the position to the instanciate function !0
-
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.0 -
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.
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 !0 -
"thank you for your answer and your amazing service !"
thanks
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?0 -
A workaround could be to instantiate at some far-away position and only with first pos update, the object shows?
But I think you agree it's not really convenient0 -
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 cheap0