private void Start() { Berubah = false; CamTejo.SetActive(false); CamButo.SetActive(true); //camTransform = transform; //cam = Camera.main; //Cursor.lockState = CursorLockMode.Locked; }
private void Update() { if (Berubah) { bapakrotasi = target2.rotation; } else { bapakrotasi = target.rotation; } bapakrotasibaru = bapakrotasi; //currentX += Input.GetAxis("Mouse X"); //currentY += Input.GetAxis("Mouse Y"); //currentX += (Input.GetAxis("Mouse X") * sensivityX); //currentY += (Input.GetAxis("Mouse Y") * sensivityY); //currentY = Mathf.Clamp(currentY, Y_Angle_MIN, Y_Angle_MAX); if (Input.GetKeyDown(KeyCode.B) && theGame.canTransform == true) { Cooldown.isCooldown = true; if (Berubah) { theGame.arrowActive = false; target.rotation = bapakrotasibaru; CamTejo.SetActive(false); CamButo.SetActive(true); Berubah = false; } else { target2.rotation = bapakrotasibaru; CamButo.SetActive(false); CamTejo.SetActive(true); Berubah = true; } } if (Input.GetKeyUp(KeyCode.B)) { Cooldown.isCooldown = false; } }