- Home /
Move gameobject to button in new 4.6?
I'm trying to figure out a way to move a gameobject underneath a new UI button, here is my current script:
public Button button;
Vector3 positioning = Camera.main.ScreenToWorldPoint(button.transform.position);
this.transform.position = Vector3.Lerp(this.transform.position, positioning, Time.deltaTime * 5);
however I'm having it trouble getting it working(it moves to an incorrect position, notably x/y), does anyone know how I would do this? I'm using c# but converting from javascript is easy
Comment