- Home /
Question by
siddharth3322 · Nov 01, 2014 at 12:05 PM ·
gameobjectpathfindingitween
Create smooth animation in path finding
I have written algorithm of path finding and it works nicely. For this following tutorial help me a lot : Introduction to A* Pathfinding
In this, I am moving my main player tile per tile towards target. But it creates very poor animation.
I have used following code for this purpose.
private void MoveToNextWayPoint(int waypoint)
{
if (waypoint < closedList.Count)
{
iTween.MoveTo(playerAObject, iTween.Hash("x", closedList[waypoint].transform.position.x, "y", closedList[waypoint].transform.position.y,
"time", 0.25f, "easetype", iTween.EaseType.linear, "oncompletetarget", gameObject, "oncomplete",
"MoveToNextWayPoint", "oncompleteparams", waypoint + 1));
}
}
Basically I want to say that player stop at one time and start travelling for next tile. So that this movement looks very poor experience.
I want your help to make this correct. If you want any more information then ask me.
Comment
Your answer

Follow this Question
Related Questions
Scale an iTweenPath 0 Answers
Game Development Approach 0 Answers
How do I make objects disappear as they are touched? 1 Answer
How would I go about moving a group of objects as one using iTween? 1 Answer
iTween gradual jump 2D 0 Answers