Hi, I was wondering if I could get any help. I am making a multiplayer fps game. I sync movement using photon view observing photon transform view - with lerping. However, when ever I send out an RPC call on fire weapon(even if the call does nothing), the movement lags/jerks for a brief moment. The maximum rate of fire is once every 0.5f so it's not like I'm sending out a huge amount of RPC calls (only 2 members in room). I looked at msg/s and I was only maxing out at 50.
The rpc call is:
m_PhotonView.RPC("muzzleflashonother", PhotonTargets.Others, m_PhotonView.viewID);
the corresponding function is:
[PunRPC]
void muzzleflashonother(int viewIDFlasher)
{
// PhotonView.Find(viewIDFlasher).gameObject.GetComponent().othermuzflashplay();
}
Not that even with the PhotonView.Find line disabled, the lag is still very noticeable. If, during test I move back and forth in front of the player without firing, movement is for the most part fairly smooth. However the moment I start hitting the fire button, when it goes off every 0.5f, the player who is doing the firing lags then jerks to the next position. Is there any reason why a PunRPC call would interfere with the lerping from photon transform view? Thank you for your help.
The rpc call is:
m_PhotonView.RPC("muzzleflashonother", PhotonTargets.Others, m_PhotonView.viewID);
the corresponding function is:
[PunRPC]
void muzzleflashonother(int viewIDFlasher)
{
// PhotonView.Find(viewIDFlasher).gameObject.GetComponent().othermuzflashplay();
}
Not that even with the PhotonView.Find line disabled, the lag is still very noticeable. If, during test I move back and forth in front of the player without firing, movement is for the most part fairly smooth. However the moment I start hitting the fire button, when it goes off every 0.5f, the player who is doing the firing lags then jerks to the next position. Is there any reason why a PunRPC call would interfere with the lerping from photon transform view? Thank you for your help.