Advertisement
DugganSC

Untitled

Feb 22nd, 2024
37
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.39 KB | None | 0 0
  1. private void Update()
  2. {
  3. if (isExamining && Input.touchCount > 0)
  4. {
  5. // Get first touch
  6. Touch touch = Input.GetTouch(0);
  7. if (touch.phase == TouchPhase.Moved) {
  8. Vector3 rotation = new Vector3(touch.deltaPosition.x, touch.deltaPosition.y, 0) * _rotSpeed * Time.deltaTime;
  9. _examinedObject.transform.Rotate(rotation);
  10. }
  11. }
  12. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement