diff --git a/Aimbot b/Aimbot new file mode 100644 index 000000000..11a631027 --- /dev/null +++ b/Aimbot @@ -0,0 +1,89 @@ +Aimbot +using UnityEngine; +using Mediapipe.Unity; + +public class HeadTracking : MonoBehaviour +{ + public FaceLandmarkDetector faceDetector; + public Transform playerCamera; + + void Update() + { + if (faceDetector == null || faceDetector.CurrentResult == null) + return; + + var landmarks = faceDetector.CurrentResult; + + // نقاط تظهر اتجاه الرأس + Vector3 nose = landmarks[1]; + Vector3 leftEye = landmarks[33]; + Vector3 rightEye = landmarks[263]; + + // حساب المحور الأفقي + float horizontal = (rightEye.x - leftEye.x); + + // حساب ارتفاع الوجه + float vertical = (nose.y - leftEye.y); + + // تدوير كاميرا اللاعب حسب حركة الرأس + playerCamera.localRotation = Quaternion.Euler( + vertical * -30f, // Pitch + horizontal * 40f, // Yaw + 0 + ); + } +} +using UnityEngine; + +public class GyroHeadTracking : MonoBehaviour +{ + void Start() + { + Input.gyro.enabled = true; + } + + void Update() + { + Quaternion rotation = Input.gyro.attitude; + rotation = new Quaternion(rotation.x, rotation.y, -rotation.z, -rotation.w); + + transform.localRotation = rotation; + } +} + + + + + +