Hello. I’m using Photon to make a multiplayer VR game. First player is on Oculus and the second is on vive. When I move object by first player (master) its barely ok. It doesn’t synchronize when Im holding object, but when i drop it, it’s in the correct position for both players. Player who joined to the server can move object like first (no synchronization while moving) but when i drop Object more than half Meter from its parent position its localPosition changes on (0,0,0).
This is my Script:
public void grabbedBy (Transform grabber)
{
Debug.Log(grabber.parent.name);
//if (photonView.owner == PhotonNetwork.player)
{
transform.SetParent(grabber);
}
grabbed = true;
_grabber = grabber.gameObject;
GetComponent<Rigidbody>().useGravity = false;
GetComponent<Rigidbody>().isKinematic = true;
}
public void realesedBy(Transform grabber, Vector3 linearVelocity, Vector3 angularVelocity)
{
Rigidbody rigidbody = GetComponent<Rigidbody>();
grabbed = false;
//rigidbody.useGravity = true;
//rigidbody.velocity = linearVelocity;
//rigidbody.angularVelocity = angularVelocity;
//GetComponent<Rigidbody>().useGravity = true;
GetComponent<Rigidbody>().isKinematic = false;
transform.SetParent(GameObject.Find("handler").transform);
_grabber = null;
}
private void OnTriggerEnter(Collider other)
{
//photonView.TransferOwnership(other.gameObject.GetPhotonView().ownerId);
}
private void OnTriggerExit(Collider other)
{
//photonView.TransferOwnership(0);
}
I don’t know what should do with that