hello everyone,
in my game i have to move my ball from one cube to another cube. i used itween.moveto its working. when i tap on screen the ball is move but when i tap multi time speedily that time ball move with some jerk.it was look bad. so please help me to move ball one position to another position using itween and other method is also available here so tell me another method also. please help to solve this problem.
here i use this code…
private void JumpPlayer (bool dir=true)
{
if (dir)
{
iTween.MoveBy (player, iTween.Hash (“y”, lobHeight, “time”, lobTime / 2, “easeType”, iTween.EaseType.easeOutQuad));
iTween.MoveBy (player, iTween.Hash ("y", -lobHeight, "time", lobTime / 2, "delay", lobTime / 2, "easeType", iTween.EaseType.easeInCubic));
iTween.MoveTo (gameObject, iTween.Hash ("position", nextPos, "time", lobTime + 0.05f, "easeType", iTween.EaseType.linear, "oncomplete", "com"));
}
else
{
iTween.MoveTo (gameObject, iTween.Hash ("position", nextPos, "time", lobTime + 0.05f, "easeType", iTween.EaseType.linear, "oncomplete", "com"));
}
}
void com ()
{
gameObject.transform.position = nextPos;
player.transform.localPosition = Vector3.zero;
}