Ok, so I’m making a 2D game within a Canvas. Firstly I instantiate a Panel with a grid layout.
Then I instantiate a bunch of buttons(Bubble(Clone)) with 1 child(Bubble Letter(Clone)) - the child of this button is what I’m trying to move into place on the grid. The runtime hierarchy looks like this:
The code I’m using only moves the object on the x-axis - the y axis position stays the same. I’m running this within Update():
transform.GetChild(0).position = Vector2.MoveTowards(transform.GetChild(0).position, canvas.transform.GetChild(6).GetChild(0).position, flySpeed*Time.deltaTime);
Any help or ideas will be much appreciated.
Many Thanks