I am making a 2D endless runner platformer sorta game where the player could collect Power Ups one of which is the Magnet,after collecting it the player has 5-15 seconds where all the coins that are overlaping need to be moved towards him the problem is i cannot get their transform position since the script is attached to the player game object and the overlaping is placing only the colliders in my collider2D array.I have managed to get the overlaping do its job and store only coins that are near the player but i am having difficulties moving them.When testing the i get the debug.logs i set up so everything is as is should be except the MoveTowards line i think it doesnt do anything.
`public Collider2D[] Colliders;
public LayerMask coinCheckLayerMask
if (StartMagnetTimer && !dead)
{
MagnetTimer += Time.deltaTime;
Vector2 pointA = (transform.position);
pointA.x -= 3;
pointA.y -= 3;
Vector2 pointB = (transform.position);
pointB.x += 3;
pointB.y += 3;
Colliders = Physics2D.OverlapAreaAll (pointA,pointB,coinCheckLayerMask);
if(Colliders.Length > 0)
{
Debug.Log ("Array is NOT empty");
foreach (var Collider in Colliders)
{
Vector2.MoveTowards (Collider.transform.position,transform.position,10.0f * Time.deltaTime);
Debug.Log ("Coin Moving Towards Player");
} '