Have a command not trigger when already in action?

Ok, here’s my problem, I have an onscreen button for an iOS game, and when I press it, I’m wanting it to trigger a function. Inside the function I have an iTween command to rotate a gameobject, like so:

function GunPlay() {
	iTween.rotateTo(wingMain, {"x":19.84731, "y":15.7971, "z":105.4032, "time":0.2});
}

But the thing is, every frame that my button is pushed, it’s continuously re-triggering the function, so it doesn’t even get a chance to play through. Is there a way I can check if it’s running and not have it trigger?

Thanks guys!

-Blayke

Yes, upgrade to iTween 2.0 and this will automatically work with the code you already have.

I have the latest version of iTween… doesn’t make a difference. Is there a different way around this?

ITween 2.0 doesn’t destroy duplicates that are already running on an object. If this doesn’t work try introducing a boolean that is reset with the onComplete callback.