iTween's inaccuracy of final position

So I've been using iTween for a while and it's been quite awesome, however I just noticed a very concerning issue. I have an object, my camera in this instance, that was designated to move from (0,0,0) to (38, 48, 0). This is the call:

        iTween.MoveAdd(cam.gameObject, iTween.Hash(
            "amount", FinalCamOffset,
            "time", 1.0f,
            "easeType", iTween.EaseType.easeOutExpo

Where FinalCamOffset was defined as (38, 48, 0) and shown in the output window for confirmation. Looking at where it ended up these were the camera's coords after the tween was done: (37.96289, 47.95313, 0)

You could say that the error is very slight and practically invisible in this case, but these slight errors can accumulate and throw it off its proper alignment.

Is this a real bug or am I missing something on my end?


I've never used iTween before and don't really know what it does that a simple Lerp won't, but there's something there called EaseType? It looks like it's smoothing the motion as it comes to a stop. The smoothing is so aggressive that it will eventually come to a complete halt as it gets closer and closer to its target. I suspect this would be fixed if you changed the EaseType to something else, but again, I've never used iTween.

If this doesn't solve the issue, you could always check to see if the object is within a certain distance of its destination; for instance, if the object you're moving is 0.1 unit or less away from its destination, you could command it to snap to the destination position.

A bit of a hack, but you could always force that to happen by adding an "oncomplete" argument to the hash args, which then manually sets the position to those coordinates if you're looking for pixel-perfect precision.

Hope that helps