Search Unity

Multiple Resolutions and resulting transform.position

Discussion in 'Multiplayer' started by deLord, Nov 22, 2016.

  1. deLord

    deLord

    Joined:
    Oct 11, 2014
    Posts:
    306
    So I develop this board game and start one client with a totally different resolution and aspect ratio as the host.
    The result is that the created (Instantiate) objects are not in their correct position on the client. There is not much animation but at least one which moves an image from A to B. Now since the resolution and ratio are different on server and client how do I tell my scripts to adapt to this?

    The main problem is that everything with a NetworkIdentity will have this behavior, but since my understanding is that shared objects on the server need a NetworkIdentity there should be a standard way of solving this problem. My canvas scales with screen size and machtes the height.

    Any help appreciated :)
     

    Attached Files:

  2. robochase

    robochase

    Joined:
    Mar 1, 2014
    Posts:
    244
    ....are things actually going to the wrong world position? or is your problem that they aren't positioned on the screen correctly? it sounds like you're just having issues with different resolutions, not a networking problem.

    usually you can use things like Screen.width & Screen.height to adjust things accordingly
     
  3. deLord

    deLord

    Joined:
    Oct 11, 2014
    Posts:
    306
    And what about animations? It can't be that I need to fix everything "by hand" for different resolutions. I thought that is what the canvas scaler is for