I am currently running into this error:
Cannot implicitly convert type
UnityEngine.Vector3
toUnity.Engine.Transform
I am not sure on how to fix this issue because, here's the code where the issue is occurring.
target = pickedNumber.transform.position;
ball.transform.position = Vector3.MoveTowards(transform.position, target.position, step);
Here's the for
loop that contains the above snippet:
float waitTime = 8;
float step = speed * Time.deltaTime * 2;
yield return new WaitForSeconds (waitTime);
for (int i = 0; i <= 19; i++) {
//Finding Game Objects
numbers = GameObject.FindGameObjectsWithTag ("num");
ball = GameObject.FindGameObjectWithTag ("ball");
//Picking the random cube
index = Random.Range (0, numbers.Length);
pickedNumber = numbers [index];
//Moving ball to cube
target = pickedNumber.transform.position;
ball.transform.position = Vector3.MoveTowards(transform.position, target.position, step);
//Pause here
yield return new WaitForSeconds (waitTime);
//Ball Returns to position
ball.transform.position = new Vector3 (0, 0, 0);
}