Quantcast
Channel: Recent Discussions — Photon Engine
Viewing all articles
Browse latest Browse all 15755

Playing with Android and PC

$
0
0
When i run my game with both clients on PC it work's just fine, but when i try with one on Android and another on PC, the strem.ReadNext(); always gives me the error, "Invalid casting type".
if (stream.isWriting)
{
// We own this player: send the others our data
stream.SendNext(_moveRight);
stream.SendNext(_moveLeft);
stream.SendNext(_moveUp);
stream.SendNext(_moveDown);
stream.SendNext((Vector2)transform.position);
}
else
{
// Network player, receive data
_moveRight = (bool)stream.ReceiveNext();
_moveLeft = (bool)stream.ReceiveNext();
_moveUp = (bool)stream.ReceiveNext();
_moveDown = (bool)stream.ReceiveNext();
_networkPosition = (Vector2)stream.ReceiveNext();

_networkDistance = Vector2.Distance(_networkPosition, transform.position);
}

Viewing all articles
Browse latest Browse all 15755

Trending Articles