Hello, I have a child game object that is not matching up with the rest of the child game objects when it comes to its speed. This 1 child object moves faster than the rest of the child game objects when they should all move the same speed when the function is called. I don’t know what’s causing this.
public float speed, radius;
Vector3 v;
foreach (Transform child in transform)
{
if (Vector2.Distance(child.transform.position, v) < radius)
{
{
child.transform.position = Vector2.MoveTowards(child.transform.position, center.position, -1 * speed);
}
}
}