Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Detecting Swing Up and Down ("Fishing") Motion

Discussion in 'Scripting' started by jaelly, Jul 5, 2022.

  1. jaelly

    jaelly

    Joined:
    Feb 13, 2016
    Posts:
    2
    Hi all! So I am wondering if it is possible to detect a swing up and down (i.e., like casting a fishing pole) motion using either the accelerometer or the gyroscope, or both. I want to detect the motion of the phone, not just a flick on the screen. If anyone has any suggestions, let me know!
     
  2. arfish

    arfish

    Joined:
    Jan 28, 2017
    Posts:
    777
    Hi,

    Are you planning to hold the phone as a casting rod? How about putting a fishing rod in to the scene, and control it with the gyro. Like in this tutorial for controlling the camera with the gyro:

     
  3. jaelly

    jaelly

    Joined:
    Feb 13, 2016
    Posts:
    2
    Hi! I am planning on holding the phone and using the phone as a fishing rod. I want to swing the phone up and down to cast the fishing line. I will check this tutorial out. Thanks!