Playing with Android and PC
Options
Elias
✭
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); }
0
Comments
-
Found the problem, when i use android the script for my character is other one with a different stream.0