Detecting 360 degree spin on local y axis

Maybe it’s a simple questioan and there are some similar topics here, but nothing really helped me and I am stucked with this problem for 3 days now.

I have got an physics driven object and i want to track its “local y” or transform.up rotation on an triggered event.
I want to know if it did a 360 degree spin.
A good example for this problem is when the player makes a frontflip and you also want to know if he did some spins within.

Thx

((Expecting an answer in 35 minutes is a bit much!))

To detect ANY rotation, you can just compare transform.localRotation to the previous rotation using Quaternion.Angle()

If you wanted for just one axis, you could use transform.localRotation.eularAngle and compare to previous angle. Use a Mathf.DeltaAngle to overcome the 0/360 issue.

So, if I understand you correctly, you have an triggered event from outside, when the tracking begins (e.g. the biker jumps in the air). From then, you want to track and get informed when the bike spinned 360° in any direction, right?

Then here is something out of the blue (means: I didn’t even try to compile it ;)) that might get you an idea how I would approach this.

class DegreeTracker
{

  float angleSoFar, angleLastFrame;

  void Start() { enabled = false; } // no tracking by default

  // called from somewhere when the tracking begins
  public void StartJump()
  {
    angleSoFar = 0;
    angleLastFrame = transform.localEulerAngles[1];
    enabled = true;
  }

  void Update()
  {
    float angle = transform.localEulerAngles[1];
    angleSoFar += angleLastFrame - angle;
    angleLastFrame = angle;
    if (angleSoFar > 360)
    {
      // code for 360 clockwise comes here

      enabled = false; // finished circle, so disable tracking
    }
    else if (angleSoFar < 360)
    {
      // code for 360 counter clockwise comes here

      enabled = false; // finished circle, so disable tracking
    }
  }
}

Basically, you remember the angle from last frame and sum up the difference each frame. If you hit > or < 360, you got your circle.