In my app I have a wheel that rotates depending on the users touch. Is there anyway to be able to track the number of rotations the wheel has performed? I want an event to be triggered after the wheel as turned 3 times. I tried using: if object.rotation == 1080 then… etc but that didn’t work.
if object.rotation \> 1080 then print("DO SOMETHING") end
Without code it’s not known how you’re detecting the rotation of your object, but assuming it’s a Runtime enterFrame listener, it’s possible that (depending on a few other variables of course) the object passes the 1080 value on a frame that isn’t caught by your listener. Checking to see if the rotation is over the 1080 value ensures that the object has reached the rotation “limit”, and gives you ability to stop it’s rotation further (if that’s your desired behavior).
if object.rotation \> 1080 then print("DO SOMETHING") end
Without code it’s not known how you’re detecting the rotation of your object, but assuming it’s a Runtime enterFrame listener, it’s possible that (depending on a few other variables of course) the object passes the 1080 value on a frame that isn’t caught by your listener. Checking to see if the rotation is over the 1080 value ensures that the object has reached the rotation “limit”, and gives you ability to stop it’s rotation further (if that’s your desired behavior).