Hello
I would like to make smooth transition when player moves from one position to another.
At this moment code looks like this:
if(Input.GetKey("down") || Input.GetKey("s"))
{
transform.rotation = Quaternion.LookRotation(Vector3.back, Vector3.up);
playerPosition.z += -1;
}
When player presses key, he is moved in the proper direction, but he just “disappears” from one location, and “appears” in another. I would like to make smooth transition, so it will look nicer for the player.
Additionally I would like to make limit of maximum number of moves per certain amount of time.
~Laran
This makes that whole movement is smoother so player have to keep pressing button. I want to move player by 1 (when he presses button once), but make transition smooth, so he don't just appears in the destination position, but moves there.
– LaranHmmm similar to pokemon move style? Click once: you move to next square?
– MrVerdouxYes, exactly. My description is so chaotic :P
– LaranOk, for that I use IEnumerators. I already answered it today. Check it here: http://answers.unity3d.com/questions/587866/get-an-object-to-move-to-a-position-for-a-fixed-ti.html#answer-587869 The question is different to your but I think the answer is quite similar. Tell me if it´s not clear and I´ll try to answer it specifically for this issue.
– MrVerdouxThank you, it works:)
– Laran