Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Steering Wheel "lap" problem

Discussion in 'Physics' started by Bernis, Feb 20, 2019.

  1. Bernis

    Bernis

    Joined:
    Mar 6, 2018
    Posts:
    2
    So, yesterday my friend asked me for advice on how to detect when a steering wheel completed a lap, the laps can be done clockwise and anticlockwise and it starts a an origin angle (0°, in this case the north), so if the steering wheel goes from 0° to 359° but does doesn't completes and starts to decrease until 0° again it should not count as a lap.
    Since he was in a 10 minutes deadline we couldn't make it work, so I just want some kick in the right direction on how to tackle this or some pseudo code if possible, as i'm intrigued on how to do it the best way.
     
  2. SparrowGS

    SparrowGS

    Joined:
    Apr 6, 2017
    Posts:
    2,536
    Keep a variable with the absolute angle and use that instead of the current "actual" rotation