void LookAtMouse() { Ray ray = CameraManager.instance.PlayerCamera.ScreenPointToRay(Input.mousePosition); float distance; if (mouseInteractionPlane.Raycast(ray, out distance)) { Vector3 hitPoint = ray.GetPoint(distance); // !!! store whole vector b/c y will be used for aiming later // !!!!! TODO(also in player) should be animation based, this is temp CharacterInstance.AimAt(hitPoint); // !!! TODO animate turn ? //float turn; if (Mathf.Abs(Vector3.Angle(transform.forward, (hitPoint - transform.position))) > 90) // if already facing correct direction, no need to turn { transform.RotateAround(transform.position, transform.up, 180); //turn = -transform.forward.x; } else { //turn = 0; } } }