There's a few ways to approach it. These might not be the most elegant, but depending on the situation, it should work. 1) Reset the gear rotate. If gear.rotateY is 360 or more, set to 0. or 2) Create a variable or attribute instead of hardcoding 360. If gear.rotateY is greater than the variable (which starts at 360) add 360 to the value you're testing against.