- Home /
Question by
RawSpartano · Apr 26, 2015 at 08:35 PM ·
camerauicanvasscriptingbasics
placing a text on to an platform, on infinite runner
hy to all, i am doing the infinite runner tutorial with catlike coding (http://catlikecoding.com/unity/tutorials/runner/), the project makes you create an queue, you instantiate 10 prefabs, you give them an position and an offset distance, and after you recycle them:
`if(objectQueue.Peek().localPosition.x + recycleOffset void Recycle(){...
Transform o = objectQueue.Dequeue();
Vector3 textPosition= camera.WorldToScreenPoint(o.position);
slowText.rectTransform.anchoredPosition=new Vector2(textPosition.x,textPosition.y);
... }
but it doesnt work. when i try to print textPosition.x it goes form 1000 to 7 to -25, to 350. i dont get it why it gives me those values. is there another method to put an text on each prefab when enters the camera fied of view? thank you bye bye
Comment