// Update is called once per frame void Update() { if (!isLocalPlayer) { return; } if (Input.GetMouseButtonDown(1)) { RaycastHit hit; Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); if (Physics.Raycast(ray, out hit)) { if (hit.transform.name == "Ground") { GetComponent <MoveNavMeshAgentSync>().Move(hit.point); } } } if (Input.GetButtonDown("Fire1")) { if (_attackHelper != null) { _attackHelper.Attack(); } } }