Search Unity

Network M2H on 2D Platformer (Use Tuto 3)

Discussion in 'Multiplayer' started by Stony05, Oct 22, 2014.

  1. Stony05

    Stony05

    Joined:
    Oct 22, 2014
    Posts:
    2
    Hi everyone!

    I'm stuck with the script of M2H (Tutorial 3) to a network ..
    I make a 2d platform game. M2H script works, but I can not convert it to a 2d game :(

    I tried to make a jump function, but it is not synchronized with the server, suddenly it bugs do, and I do not program the PlayerController because there are "input.getaxis" when logiquemet i used "Input.GetKey (KeyCode.W)"..

    Base of update (By M2H)
    Code (CSharp):
    1.  
    2.     void Update()
    3.     {
    4.  
    5.         //Client code
    6.         if (Network.player == owner)
    7.         {
    8.             //Only the client that owns this object executes this code
    9.             float HInput = Input.GetAxis("Horizontal");
    10.             float VInput = Input.GetAxis("Vertical");
    I do not understand how to synchronize the code with a 2D platform, how to manage interactions? The input.getaxis can be changed?

    How setup and syncronize a jump ?

    I'm really lost :(