- Home /
Moving object through waypoints instanly issue
Hello everyone! Im currently trying to make an outline effect for my symbol, by moving gameObject with particle effect by points, but i stuck with a problem, when there are too many point close to each other speed is different, im using simple coroutine to check if target is close to a point then move to another and it works.But as you can look from image speed is different based on how many points i have. Speed value is 100, and changing more makes no difference/
IEnumerator Animate(float speed)
{
for (int i = 0; i < symbolDatabase.symbols[symbol].points.Count; i++)
{
while (Vector3.Distance(particle.transform.position, new
Vector3((float)symbolDatabase.symbols[symbol].points[i].x,
(float)symbolDatabase.symbols[symbol].points[i].y, -7)) > .0001f)
{
particle.transform.position = Vector3.MoveTowards(particle.transform.position, new
Vector3((float)symbolDatabase.symbols[symbol].points[i].x,
(float)symbolDatabase.symbols[symbol].points[i].y, -7), Time.deltaTime * speed);
yield return null;
}
}
}


Your answer
Follow this Question
Related Questions
Character input key doesnt work 1 Answer
Trouble with correct move and rotation of Rigibody 0 Answers
How to make 2D multiple waypoints for sidescroller shooter or some other similiar movement 1 Answer
I want the camera to follow just the X coordinate of the player. 1 Answer
Rotating Player 0 Answers