public void GetInputs() { #region Movement Vector3 direction = new Vector3(); if (Input.GetKey(KeyCode.W)) { direction += transform.forward; } if (Input.GetKey(KeyCode.S)) { direction -= transform.forward; } if (Input.GetKey(KeyCode.A)) { direction -= transform.right; } if (Input.GetKey(KeyCode.D)) { direction += transform.right; } movementController.Move(direction); #endregion #region Turning turningController.RotateX(Input.GetAxis("Mouse X")); turningController.RotateY(Input.GetAxis("Mouse Y")); #endregion #region Attack if (Input.GetMouseButtonDown(0)) { foreach (Collider obj in Physics.OverlapSphere(transform.forward * 2, 2)) { if (obj.GetComponent <HealthSystem>() && obj.transform != this.transform) { attack.Attack(obj.GetComponent <HealthSystem>(), 5); } } } #endregion }