Hello, don’t know why but when Im raycasting using [Command] attribute and saving it on SyncVar I got different results on remote client and host, why is that?!
[SyncVar] public clickPos;
[Command]
private void CmdFirst()
{
Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition);
RaycastHit hit;
if (Physics.Raycast(ray, out hit, 1000f))
{
clickPos = hit.point;
clickPos.y = 1f;
}
}
It looks like that world coords are different for host and clients?! Please help.