How to work out specific rotation

I’m making a small mobile game around diving for a game jam. the game uses your phone gyro to tilt the character so you can spin him back and forth. I’m having a bit of a problem trying to work out how to count spins for flips
and also work out when he is facing down so I can switch graphics to dive graphics

This is my current logic with half works. but cause rotation seems to go to 90 then 0 if changes to dive graphics whenever there up straight as well as when upside down.

][1]

Hey Gizmo,

Your screenshot did not appear to post properly. I’ve had some experience using a phone’s gyro device while programming for Unity and it usually returns a value between 1 and -1.

There are multiple ways to implement the rotation of the character. Do you want it to constantly rotate with the changes to the device’s orientation? Or just change the character’s rotation to face down when the device has been found to be tilted down?

][1]

I have the tilt connected to the rotation rate so you can spin the character back and forth but not directly connected to the tilt direction.
I want to know when the character is facing directly down and probably about 10 degrees each way from straight down

counting rotations is seriously close to impossible in unreal. i’m sure i will be a bald man by the time i work this out

For the Record i’m not a bald man.

however i did work it out
counting rotations i used the rotation rate to add to a variable which counted up to 360 then would set flips to 1 and reset to 0 or same in reverse.

and as for the flipping i had to use X as well as Y so when ever X was between -10m and 10 and Y was > 170 dive was true,

hope this helps for anyone else