I am working on a game where the user can draw curves by touching the screen (for Android).
At the moment, the curve lags behind the finger by 1cm even when moving only moderately fast. It always catches up with the finger when the finger slows down enough (so it is not a transformation issue).
To give you an idea of the code, here is a simplified version (that exhibits the same lagging behaviour), where the someObjectInScene follows the finger.
public void Update()
{
//for this, example, ignore all other touches
if(Input.touchCount > 0)
{
newPosition = ConvertScreenToWorld(Input.GetTouch(0).position);
someObjectInScene.transform.position = newPosition;
}
}
In another test, I have only the curve drawing functionality, without the rest of the game. There it seems responsive enough, so this makes me think the lower frame rate of the game influences the responsiveness (although it is not terribly low 25/30 FPS).
Edit: As another test, I added a simple background image on a plane to the test above. The lag becomes somewhat visible. When I add 5-layers of alpha-background (as we use in the actual game), the frame-rate drops enough and I see lag very clearly.
Am I totally off track, missing something?
If not, how can I make the player experience more enjoyable (it is damn annoying - the curve is used to steer things), i.e. how I can I "hide" the lag?
Edit: I experimented a bit with using prediction, but it gives very poor results: it is very jerky, tends to overshoot, and is totally off when the finger is moving along a curve and not just straight.
Edit: Also, there is a very similar game that runs without any visible lag on the same device. This makes it seem like it can't be the hardware (or they are using a cool trick to overcome the problem).
Edit: What we ended up doing: We could never found a good solution. What we did was to make our game run really fast, so that the lag was minimised and not very obvious. This need for very high performance was a big strain on the project, and we had to cut a lot of glitz. When we moved to iPhone, we had a whole new set of performance issues, but the input lag there was not obvious, if present at all.