- Home /
Question by
ShNabeelAnwar · Jul 13, 2017 at 08:54 PM ·
triggertransform.positionflycoin
How to make coins fly toward coin meter like Temple Run
Can anyone help me to fly coins toward the coins meter.
I have try this code.
public GameObject meter;
void Update () {
transform.position = Vector3.Lerp(transform.position, meter.transform.position, 1.5f * Time.deltaTime);
}
But it's not working for me. Maybe because the CoinsMeter is UiImage with text in my case. So please help me to solve this.
Thanks in advance.
Comment
Answer by Bieere · Jul 14, 2017 at 01:43 PM
You'll need to convert ScreenSpace to World space essentially: