Build issues

Options
when i built the game and testing online when another player joins we cant see each other but there are two charcters that i control both
http://eraracing.com/nathan/Shooter/builds.html

Comments

  • Hey mate, I've got troubles loading your webplayer.
    But, I think I can help you on this.

    The main thing is telling your own character to move while the others won't.
    How?

    1. Make a prefab of your character.

    2. Attach a "PhotonView" script on it.

    3. Make your NetworkCharacterMove script with, for example, a "public bool move = false;"
    > Note that this script will have its class inheritate of "Photon.MonoBehaviour"

    4. Attach this script to your prefab and drag this script into your "Observe" parameter of your previously attached PhotonView (then set it to, for example, "Reliable Delta Compressed")

    5. In this class, you will then have to add a function like this:

    void Update()
    {
    if (!photonView.isMine)
    {
    this.transform.position = Vector3.Lerp(this.transform.position, this.correctPlayerPos, Time.deltaTime * 5);
    this.transform.rotation = Quaternion.Lerp(this.transform.rotation, this.correctPlayerRot, Time.deltaTime * 5);
    }
    }

    void OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info)
    {
    if (stream.isWriting)
    {
    // We own this player: send the others our data
    stream.SendNext(transform.position);
    stream.SendNext(transform.rotation);
    }
    else
    {
    // Network player, receive data
    this.correctPlayerPos = (Vector3)stream.ReceiveNext();
    this.correctPlayerRot = (Quaternion)stream.ReceiveNext();
    }
    }

    I think that will be enough, tell me :)