2
votes

I am working on a multlayer third person game and I am using motion controller for animations and photon for network manager.I ahve a problem: when I connect and join the room the other players don't move on others player screen. They move only on their devices. Here is what I deactivated:

using UnityEngine;
using com.ootii.Input;
using com.ootii.Actors;
using com.ootii.Actors.AnimationControllers;

public class netView : Photon.MonoBehaviour {

    public Camera cam;
    public UnityInputSource uis;
    public GameObject canvas;
    public ActorController ac;
    public MotionController mc;

    // Use this for initialization
    void Start () {
        if (photonView.isMine) {
            cam.enabled = true;
            uis._IsEnabled = true;
            canvas.active = true;
            ac.enabled = true;
            mc.enabled = true;
        } else {
            cam.enabled = false;
            uis._IsEnabled = false;
            canvas.active = false;
            ac.enabled = false;
            mc.enabled = false;
        }
    }

}

Here is a video: https://youtu.be/mOaAejsVX04 . In it i am playing in editor and on my phone. In my device I move around and the editor player does not move. Also in editor, the player from the device just stays there, doesn't move while on phone is moveing around. For input I am using CrossPlatformManager class. How can I repair it?

1

1 Answers

3
votes

In your case I think the problem is that you don't synchronize the transform to begin with. You need either a PhotonTransformView Component attached to your network object, with a photonView observing that PhotonTransformView, or inside your network behaviour manually writing and reading to that network object stream.

I strongly encourage you do go through the basic tutorial which will show you all the above technique step by step:

https://doc.photonengine.com/en-us/pun/current/demos-and-tutorials/pun-basics-tutorial/player-networking#trans_sync

https://doc.photonengine.com/en-us/pun/current/demos-and-tutorials/pun-basics-tutorial/player-networking#beams

it doesn't matter the input technique you use, what matters is the synchronization of the transform.