Apologies for the double posting, but I have a question regarding tile based movement now.
// UP
if (Input.GetKey(KeyCode.UpArrow))
{
direction = 0;
walk = true;
// this.transform.position = new Vector3(this.transform.position.x, this.transform.position.y + 1, this.transform.position.z);
if (map.GetTileAtPosition(currTile, out mapX, out mapY))
{
destTile = new Vector3(currTile.x, map.GetTilePosition(mapX, mapY + 1).y + (map.partitionSizeY / 2), currTile.z);
HOTween.To(this.transform, 1, "position", destTile);
}
}
I'm using HOTween to tween him between two spots but it looks rather "janky" for lack of a better term. The player sprite essentially stutters between tiles. I believe this has to do with the duration of the tween, but when setting it to 0 the player can basically fly across the map in a matter of seconds because they move so fast. I understand this is not 2DToolkit related, but do you have any tips on this front?
Also more related to the plugin, is there an easier way to make sure the player aligns with the tile properly? currTile represents the players world position in a Vector3() (I need to change the name of that variable >.>), destTile is also a Vector3 that represents the world position (also should change the name of that variable).
Thanks again!